From 619aeeba9064012f24d766eea7e00b8f07940f29 Mon Sep 17 00:00:00 2001 From: Feng Date: Tue, 25 Aug 2015 13:48:28 +0800 Subject: [PATCH 1/3] update dashboard --- plugins/emqttd_dashboard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emqttd_dashboard b/plugins/emqttd_dashboard index c87d9c458..edbb6dc08 160000 --- a/plugins/emqttd_dashboard +++ b/plugins/emqttd_dashboard @@ -1 +1 @@ -Subproject commit c87d9c4580e568917b4b026c809becf2cccd469e +Subproject commit edbb6dc0862973137b056248efb5940d003d75be From 2e22de6123b2f88457e22e4358a273d71d427037 Mon Sep 17 00:00:00 2001 From: Feng Date: Tue, 25 Aug 2015 13:49:16 +0800 Subject: [PATCH 2/3] 0.10.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f46977d8a..d59ca6535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ emqttd ChangeLog ================== +0.10.1-beta (2015-08-25) +------------------------- + +Bugfix: issue#259 - when clustered the emqttd_dashboard port is close, and the 'emqttd' application cannot stop normally. + +Feature: issue#262 - Add 'http://host:8083/mqtt/status' Page for health check + + 0.10.0-beta (2015-08-20) ------------------------- From 4698d040fdb83a1c544dd29ffd30b3a424e86769 Mon Sep 17 00:00:00 2001 From: Feng Date: Tue, 25 Aug 2015 13:49:28 +0800 Subject: [PATCH 3/3] fix issue #262 --- src/emqttd_http.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/emqttd_http.erl b/src/emqttd_http.erl index 586c48546..946ad0b65 100644 --- a/src/emqttd_http.erl +++ b/src/emqttd_http.erl @@ -39,6 +39,17 @@ handle_request(Req) -> handle_request(Req:get(method), Req:get(path), Req). +handle_request('GET', "/mqtt/status", Req) -> + {InternalStatus, _ProvidedStatus} = init:get_status(), + AppStatus = + case lists:keysearch(emqttd, 1, application:which_applications()) of + false -> not_running; + {value, _Ver} -> running + end, + Status = io_lib:format("Node ~s is ~s~nemqttd is ~s~n", + [node(), InternalStatus, AppStatus]), + Req:ok({"text/plain", iolist_to_binary(Status)}); + %%------------------------------------------------------------------------------ %% HTTP Publish API %%------------------------------------------------------------------------------