luci-app-statistics: add dhcpleases
Add the dhcpleases plugin: https://github.com/openwrt/packages/pull/14204 Added-Frontend-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Nick Hainke <vincent@systemli.org> [Minor changes to graph: alt_autoscale, precision, label] Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
This commit is contained in:
parent
7b5b7fbcd6
commit
f8552afb1c
4 changed files with 59 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
/* Licensed to the public under the Apache License 2.0. */
|
||||
|
||||
'use strict';
|
||||
'require baseclass';
|
||||
|
||||
return baseclass.extend({
|
||||
title: _('DHCP Leases'),
|
||||
|
||||
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
|
||||
return {
|
||||
title: "%H: DHCP leases",
|
||||
alt_autoscale_max: true,
|
||||
vlabel: "Leases given",
|
||||
number_format: "%3.0lf",
|
||||
data: {
|
||||
types: [ "count" ],
|
||||
options: {
|
||||
count: {
|
||||
title: "Leases"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
|
@ -0,0 +1,21 @@
|
|||
'use strict';
|
||||
'require baseclass';
|
||||
'require form';
|
||||
|
||||
return baseclass.extend({
|
||||
title: _('DHCP Leases Plugin Configuration'),
|
||||
description: _('The dhcpleases plugin collects information about assigned DHCP leases.'),
|
||||
|
||||
addFormOptions: function(s) {
|
||||
var o;
|
||||
|
||||
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
|
||||
|
||||
o = s.option(form.Value, 'Path', _('DHCP leases file'));
|
||||
o.default = '/tmp/dhcp.leases';
|
||||
},
|
||||
|
||||
configSummary: function(section) {
|
||||
return _('Monitoring DHCP leases enabled');
|
||||
}
|
||||
});
|
|
@ -86,6 +86,10 @@ config statistics 'collectd_df'
|
|||
option IgnoreSelected '0'
|
||||
option ValuesPercentage '0'
|
||||
|
||||
config statistics 'collectd_dhcpleases'
|
||||
option enable '0'
|
||||
option Path '/tmp/dhcp.leases'
|
||||
|
||||
config statistics 'collectd_disk'
|
||||
option enable '0'
|
||||
option Disks 'hda1 hdb'
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"title": "Dhcpleases",
|
||||
"category": "network",
|
||||
"legend": [
|
||||
[],
|
||||
[],
|
||||
["Path"]
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue