Skip to content

Commit 2b85b93

Browse files
committed
Display alarms
1 parent 6047fd2 commit 2b85b93

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

doc/Troubleshooting.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,16 @@ device a downlink shall be sent. You have two options:
133133
The problem is the Lorank8 proprietary message format. In your gateway config
134134
you likely have `stat_format` set to `idee_concise` or `idee_verbose`. You need
135135
to change `stat_format` to `semtech` to get this working.
136+
137+
138+
## Alarms
139+
140+
Server alarms are indicated in the web-admin Dashboard.
141+
142+
### system_memory_high_watermark
143+
144+
This indicates that the system has less than 20% of free memory.
145+
146+
### disk_almost_full
147+
148+
This indicates there is less than 20% of free disk space.

priv/admin/admin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
154154
nga.field('memory').label('Free Memory')
155155
.map(map_memstats),
156156
nga.field('disk').label('Free Disk')
157-
.map(map_diskstats)
157+
.map(map_diskstats),
158+
nga.field('alarms', 'choices')
158159
])
159160
.batchActions([]);
160161
// add to the admin application
@@ -749,7 +750,8 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
749750
nga.field('memory').label('Free Memory')
750751
.map(map_memstats),
751752
nga.field('disk').label('Free Disk')
752-
.map(map_diskstats)
753+
.map(map_diskstats),
754+
nga.field('alarms', 'choices')
753755
])
754756
)
755757
.addCollection(nga.collection(gateways)

src/lorawan_admin_servers.erl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ get_stats(Req, State) ->
3131
{jsx:encode([[{node, node()},
3232
{modules, get_modules()},
3333
{memory, memsup:get_system_memory_data()},
34-
{disk, get_disk_data()}]]), Req, State}.
34+
{disk, get_disk_data()},
35+
{alarms, get_alarms()}]]), Req, State}.
3536

3637
get_modules() ->
3738
lists:map(
@@ -47,6 +48,13 @@ get_disk_data() ->
4748
end,
4849
disksup:get_disk_data()).
4950

51+
get_alarms() ->
52+
lists:map(
53+
fun({Id, _Desc}) ->
54+
Id
55+
end,
56+
alarm_handler:get_alarms()).
57+
5058
resource_exists(Req, State) ->
5159
{true, Req, State}.
5260

0 commit comments

Comments
 (0)