var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Host', _('Monitor host'));
o.default = 'localhost';
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Flag, 'ReportByCpu', _('Report by CPU'),
_('By setting this, CPU is not aggregate of all processors on the system'));
o.default = '1';
+ o.rmempty = false;
o.depends('enable', '1');
o = s.option(form.Flag, 'ReportByState', _('Report by state'),
_('When set to true, reports per-state metric (system, user, idle)'));
o.default = '1';
+ o.rmempty = false;
o.depends('enable', '1');
o = s.option(form.Flag, 'ValuesPercentage', _('Report in percent'),
_('When set to true, we request percentage values'));
- o.default = '0';
o.depends({ 'enable': '1', 'ReportByCpu': '1', 'ReportByState': '1' });
},
title: _('CPU Frequency Plugin Configuration'),
description: _('This plugin collects statistics about the processor frequency scaling.'),
- addFormOptions: function(s) {
- var o;
-
- o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
-
- o = s.option(form.Flag, 'ExtraItems', _('Extra items'),
- _('More details about frequency usage and transitions'));
- o.default = '0';
- o.optional = true;
- o.depends('enable', '1');
- },
-
configSummary: function(section) {
- return (section.ExtraItems == '1')
- ? _('Detailled CPU frequency monitoring enabled')
- : _('Simple CPU frequency monitoring enabled');
+ return _('CPU frequency monitoring enabled');
}
});
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'DataDir', _('Storage directory for the csv files'));
- o.default = '127.0.0.1';
+ o.default = '/tmp/csv';
o.depends('enable', '1');
o = s.option(form.Flag, 'StoreRates', _('Store data values as rates instead of absolute values'));
- o.default = '0';
o.depends('enable', '1');
},
var o, ss;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.SectionValue, '__pages', form.TableSection, 'collectd_curl_page');
o.title = _('Fetch pages');
o = ss.option(form.Flag, 'enable', _('Enable'));
o.default = '1';
+ o.rmempty = false;
o = ss.option(form.Value, 'name', _('Name'));
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Devices', _('Monitor devices'));
o.optional = true;
};
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
o.depends('enable', '1');
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Disks', _('Monitor disks and partitions'),
_('When none selected, all disks will be monitored.'));
- o.rmempty = true;
o.depends('enable', '1');
o.load = function(section_id) {
return fs.trimmed('/proc/partitions').then(L.bind(function(str) {
};
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
o.depends('enable', '1');
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(widgets.DeviceSelect, 'Interfaces', _('Monitor interfaces'),
_('When none selected, all interfaces will be monitored.'));
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'SocketFile', _('Socket file'));
o.default = '/var/run/collect-email.sock';
o = s.option(widgets.GroupSelect, 'SocketGroup', _('Socket group'));
o.default = 'nogroup';
o.optional = true;
- o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.Value, 'SocketPerms', _('Socket permissions'));
o.default = '0770';
o.optional = true;
- o.rmempty = true;
o.depends('enable', '1');
o.validate = function(section_id, v) {
if (v == '')
o.datatype = 'range(1,16384)';
o.default = '5';
o.optional = true;
- o.rmempty = true;
o.depends('enable', '1');
},
var o, ss;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.SectionValue, '__input', form.TableSection, 'collectd_exec_input');
o.title = _('Add command for reading values');
o = ss.option(widgets.UserSelect, 'cmduser', _('User'));
o.default = 'nobody';
o.optional = true;
- o.rmempty = true;
o = ss.option(widgets.GroupSelect, 'cmdgroup', _('Group'));
o.default = 'nogroup';
o.optional = true;
- o.rmempty = true;
o = s.option(form.SectionValue, '__notify', form.TableSection, 'collectd_exec_notify');
o.title = _('Add notification command');
o = ss.option(widgets.UserSelect, 'cmduser', _('User'));
o.default = 'nobody';
o.optional = true;
- o.rmempty = true;
o = ss.option(widgets.GroupSelect, 'cmdgroup', _('Group'));
o.default = 'nogroup';
o.optional = true;
- o.rmempty = true;
},
configSummary: function(section) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(widgets.DeviceSelect, 'Interfaces', _('Monitor interfaces'));
o.multiple = true;
o.depends('enable', '1');
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
o.depends('enable', '1');
},
var o, ss;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
for (var family = 4; family <= 6; family += 2) {
var suffix = (family == 4 ? '' : '6');
o = ss.option(form.Value, 'table', _('Table'));
o.default = 'filter';
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.validate = function(section_id, table) {
var chain_opt = this.section.children.filter(function(o) { return o.option == 'chain' })[0],
o = ss.option(form.Value, 'chain', _('Chain'));
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.validate = function(section_id, chain) {
var table_opt = this.section.children.filter(function(o) { return o.option == 'table' })[0],
o = ss.option(form.Value, 'rule', _('Comment / Rule Number'));
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.load = function(section_id) {
var table = uci.get('luci_statistics', section_id, 'table'),
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Irqs', _('Monitor interrupts'));
o.optional = true;
};
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
- o.optional = 'true';
o.depends('enable', '1');
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(widgets.DeviceSelect, 'Interfaces', _('Monitor interfaces'), _('Leave unselected to automatically determine interfaces to monitor.'));
o.multiple = true;
};
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
o.depends('enable', '1');
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
- o = s.option(form.Flag, 'ValuesAbsolute', _('Absolute values'),
- _('When set to true, we request absolute values'));
+ o = s.option(form.Flag, 'ValuesAbsolute', _('Absolute values'), _('When set to true, we request absolute values'));
o.default = '1';
- o.optional = false;
o.depends('enable', '1');
- o = s.option(form.Flag, 'ValuesPercentage', _('Percent values'),
- _('When set to true, we request percentage values'));
- o.default = '0';
- o.optional = false;
+ o = s.option(form.Flag, 'ValuesPercentage', _('Percent values'), _('When set to true, we request percentage values'));
o.depends('enable', '1');
},
o.depends('enable', '1');
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
o.depends('enable', '1');
},
o.default = '0';
o = s.option(form.Value, 'TimeToLive', _('TTL for network packets'));
- o.default = '128';
- o.datatype = 'range(0, 255)';
- o.optional = true;
+ o.placeholder = '1';
+ o.datatype = 'range(1, 255)';
o.depends('enable', '1');
- o = s.option(form.Flag, 'Forward', _('Forwarding between listen and server addresses'));
- o.default = '0';
- o.optional = true;
+ o = s.option(form.Value, 'MaxPacketSize', _('Maximum packet size'), _('Set the maximum size for datagrams sent over the network'));
+ o.placeholder = '1452';
+ o.datatype = 'range(1024, 65535)';
+ o.depends('enable', '1');
+
+ o = s.option(form.Flag, 'Forward', _('Enable forwarding'), _('Forwarding between listen and server addresses'));
o.depends('enable', '1');
- o = s.option(form.Value, 'CacheFlush', _('Cache flush interval'),
- _('Seconds'));
- o.default = '86400';
- o.datatype = 'uinteger';
- o.optional = true;
+ o = s.option(form.Flag, 'ReportStats', _('Enable statistics'), _('Create statistics about the network plugin itself'));
o.depends('enable', '1');
o = s.option(form.SectionValue, '__listeners', form.TableSection, 'collectd_network_listen');
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'UPS', _('UPS'), _('UPS name in NUT ups@host format'));
- o.rmempty = true;
},
configSummary: function(section) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'Host', _('Host'),
_('IP or hostname where to get the txtinfo output from'));
o.datatype = 'host';
- o.rmempty = true;
o = s.option(form.Value, 'Port', _('Port'));
o.datatype = 'port';
- o.rmempty = true;
o = s.option(form.ListValue, 'CollectLinks', _('CollectLinks'),
_('Specifies what information to collect about links.'));
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Flag, 'CollectIndividualUsers', _('Generate a separate graph for each logged user'));
- o.default = '0';
- o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.Flag, 'CollectUserCount', _('Aggregate number of connected users'));
- o.default = '0';
- o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.Flag, 'CollectCompression', _('Gather compression statistics'));
- o.default = '0';
- o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.Flag, 'ImprovedNamingSchema', _('Use improved naming schema'));
- o.default = '0';
- o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.DynamicList, 'StatusFile', _('OpenVPN status files'));
- o.rmempty = true;
o.depends('enable', '1');
o.load = function(section_id) {
return L.resolveDefault(fs.list('/var/run'), []).then(L.bind(function(entries) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Hosts', _('Monitor hosts'));
o.default = '127.0.0.1';
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Processes', _('Monitor processes'));
o.default = 'uhttpd dropbear dnsmasq';
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'DataDir', _('Storage directory'),
_('Note: as pages are rendered by user \'nobody\', the *.rrd files, the storage directory and all its parent directories need to be world readable.'));
- o.default = '/tmp';
- o.optional = true;
- o.rmempty = true;
+ o.default = '/tmp/rrd';
o.depends('enable', '1');
- o = s.option(form.Value, 'StepSize', _('RRD step interval'),
- _('Seconds'));
- o.default = '30';
- o.optional = true;
- o.rmempty = true;
+ o = s.option(form.Value, 'StepSize', _('RRD step interval'), _('Seconds'));
+ o.placeholder = '30';
+ o.datatype = 'uinteger';
o.depends('enable', '1');
- o = s.option(form.Value, 'HeartBeat', _('RRD heart beat interval'),
- _('Seconds'));
- o.default = '60';
- o.optional = true;
- o.rmempty = true;
+ o = s.option(form.Value, 'HeartBeat', _('RRD heart beat interval'), _('Seconds'));
+ o.placeholder = '60';
+ o.datatype = 'uinteger';
o.depends('enable', '1');
- o = s.option(form.Flag, 'RRASingle', _('Only create average RRAs'),
- _('reduces rrd size'));
- o.default = 'true';
+ o = s.option(form.Flag, 'RRASingle', _('Only create average RRAs'), _('reduces rrd size'));
+ o.default = '1';
+ o.rmempty = false;
o.depends('enable', '1');
o = s.option(form.Flag, 'RRAMax', _('Show max values instead of averages'),
_('Max values for a period can be used instead of averages when not using \'only average RRAs\''));
- o.default = 'false';
- o.rmempty = true;
o.depends('RRASingle', '0');
o = s.option(form.DynamicList, 'RRATimespans', _('Stored timespans'));
o.default = '10min 1day 1week 1month 1year';
- o.optional = true;
- o.rmempty = true;
o.depends('enable', '1');
o.validate = function(section_id, value) {
if (value == '')
};
o = s.option(form.Value, 'RRARows', _('Rows per RRA'));
- o.default = '100';
- o.optional = true;
- o.rmempty = true;
+ o.placeholder = '1200';
+ o.datatype = 'min(1)';
o.depends('enable', '1');
o = s.option(form.Value, 'XFF', _('RRD XFiles Factor'));
- o.default = '0.1';
- o.optional = true;
- o.rmempty = true;
+ o.placeholder = '0.1';
o.depends('enable', '1');
+ o.validate = function(section_id, value) {
+ if (value == '')
+ return true;
+
+ if (value.match(/^[0-9]+(?:\.[0-9]+)?$/) && +value >= 0 && +value < 1)
+ return true;
- o = s.option(form.Value, 'CacheTimeout', _('Cache collected data for'),
- _('Seconds'));
- o.default = '100';
- o.optional = true;
- o.rmempty = true;
+ return _('Expecting decimal value lower than one');
+ };
+
+ o = s.option(form.Value, 'CacheTimeout', _('Cache collected data for'), _('Seconds'));
o.depends('enable', '1');
+ o.datatype = 'uinteger';
+ o.placeholder = '0';
+ o.validate = function(section_id, value) {
+ var flushinp = this.map.findElement('id', 'widget.cbid.luci_statistics.collectd_rrdtool.CacheFlush');
+
+ if (value != '' && !isNaN(value) && +value > 0) {
+ flushinp.placeholder = 10 * +value;
+ flushinp.disabled = false;
+ }
+ else {
+ flushinp.value = '';
+ flushinp.placeholder = '0';
+ flushinp.disabled = true;
+ }
+
+ return true;
+ };
- o = s.option(form.Value, 'CacheFlush', _('Flush cache after'),
- _('Seconds'));
- o.default = '100';
- o.optional = true;
- o.rmempty = true;
+ o = s.option(form.Value, 'CacheFlush', _('Flush cache after'), _('Seconds'));
o.depends('enable', '1');
+ o.datatype = 'uinteger';
},
configSummary: function(section) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Sensor', _('Sensor list'));
o.rmempty = true;
};
o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
- o.default = '0';
- o.rmempty = true;
o.depends('enable', '1');
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Flag, 'ListeningPorts', _('Monitor all local listen ports'));
- o.default = '1';
o.depends('enable', '1');
+ o.rmempty = false;
+ o.default = '1';
- o = s.option(form.Value, 'LocalPorts', _('Monitor local ports'));
+ o = s.option(form.DynamicList, 'LocalPorts', _('Monitor local ports'));
o.optional = true;
+ o.datatype = 'port';
o.depends({ enable: '1', ListeningPorts: '0' });
- o = s.option(form.Value, 'RemotePorts', _('Monitor remote ports'));
+ o = s.option(form.DynamicList, 'RemotePorts', _('Monitor remote ports'));
o.optional = true;
+ o.datatype = 'port';
o.depends({ enable: '1', ListeningPorts: '0' });
},
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.DynamicList, 'Device', _('Monitor device(s) / thermal zone(s)'), _('Empty value = monitor all'));
o.load = function(section_id) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
o = s.option(form.Value, 'SocketFile', _('Socket path'));
o.default = '/var/run/collect-query.socket';
end
end
- return str .. _string( c["TimeToLive"], "TimeToLive" )
- .. _string( c["CacheFlush"], "CacheFlush" )
- .. _bool( c["Forward"], "Forward" )
+ return str ..
+ _string(c["MaxPacketSize"], "MaxPacketSize") ..
+ _string(c["TimeToLive"], "TimeToLive") ..
+ _bool(c["Forward"], "Forward") ..
+ _bool(c["ReportStats"], "ReportStats")
end