From 0a547add2f4cc264380d2dab2c472efe5a1d7094 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 3 May 2014 19:17:16 +0200 Subject: graph.php: use JSON plugins instead of including PHP plugin files A couple of big changes here. A lot of logic moved to graph.php. The PHP plugin files have been rewritten to JSON. In these JSON files *everything* is optional. Also *NOT* having a JSON plugin file won't block you from having a graph. The JSON will just make the graphs prettier (by having a title, y-axis title, legend, colors, etc..). The Collectd types.db file is parsed and used to determine RRD content. When things are not defined in the JSON it will fallback to a default. --- plugin/aggregation.php | 46 ------------ plugin/apache.json | 143 +++++++++++++++++++++++++++++++++++ plugin/apache.php | 167 ----------------------------------------- plugin/apcups.json | 67 +++++++++++++++++ plugin/apcups.php | 89 ---------------------- plugin/battery.json | 35 +++++++++ plugin/battery.php | 38 ---------- plugin/bind.php | 14 ---- plugin/conntrack.json | 13 ++++ plugin/conntrack.php | 35 --------- plugin/contextswitch.json | 13 ++++ plugin/contextswitch.php | 34 --------- plugin/cpu.json | 43 +++++++++++ plugin/cpu.php | 48 ------------ plugin/cpufreq.json | 7 ++ plugin/cpufreq.php | 17 ----- plugin/dbi.php | 16 ---- plugin/df.json | 42 +++++++++++ plugin/df.php | 48 ------------ plugin/disk.json | 67 +++++++++++++++++ plugin/disk.php | 49 ------------ plugin/dns.json | 32 ++++++++ plugin/dns.php | 51 ------------- plugin/entropy.json | 13 ++++ plugin/entropy.php | 34 --------- plugin/filecount.json | 26 +++++++ plugin/filecount.php | 33 -------- plugin/hddtemp.json | 7 ++ plugin/hddtemp.php | 17 ----- plugin/interface.json | 51 +++++++++++++ plugin/interface.php | 48 ------------ plugin/ip6tables.php | 26 ------- plugin/ipmi.json | 17 +++++ plugin/ipmi.php | 43 ----------- plugin/iptables.json | 15 ++++ plugin/iptables.php | 26 ------- plugin/irq.json | 8 ++ plugin/irq.php | 18 ----- plugin/libvirt.json | 115 ++++++++++++++++++++++++++++ plugin/libvirt.php | 144 ----------------------------------- plugin/load.json | 22 ++++++ plugin/load.php | 27 ------- plugin/md.json | 7 ++ plugin/md.php | 20 ----- plugin/memcached.json | 134 +++++++++++++++++++++++++++++++++ plugin/memcached.php | 179 -------------------------------------------- plugin/memory.json | 41 ++++++++++ plugin/memory.php | 44 ----------- plugin/mysql.json | 143 +++++++++++++++++++++++++++++++++++ plugin/mysql.php | 140 ---------------------------------- plugin/netlink.json | 151 +++++++++++++++++++++++++++++++++++++ plugin/netlink.php | 122 ------------------------------ plugin/nfs.json | 8 ++ plugin/nfs.php | 31 -------- plugin/nginx.json | 51 +++++++++++++ plugin/nginx.php | 66 ---------------- plugin/ntpd.json | 22 ++++++ plugin/ntpd.php | 48 ------------ plugin/nut.json | 32 ++++++++ plugin/nut.php | 77 ------------------- plugin/openvpn.json | 30 ++++++++ plugin/openvpn.php | 42 ----------- plugin/ping.json | 16 ++++ plugin/ping.php | 37 --------- plugin/postgresql.json | 134 +++++++++++++++++++++++++++++++++ plugin/postgresql.php | 130 -------------------------------- plugin/powerdns.php | 14 ---- plugin/processes.json | 186 ++++++++++++++++++++++++++++++++++++++++++++++ plugin/processes.php | 183 --------------------------------------------- plugin/sensors.json | 17 +++++ plugin/sensors.php | 36 --------- plugin/snmp.json | 19 +++++ plugin/snmp.php | 35 --------- plugin/swap.json | 38 ++++++++++ plugin/swap.php | 50 ------------- plugin/tail.php | 29 -------- plugin/tcpconns.json | 8 ++ plugin/tcpconns.php | 17 ----- plugin/thermal.json | 12 +++ plugin/thermal.php | 24 ------ plugin/uptime.json | 14 ++++ plugin/uptime.php | 23 ------ plugin/users.json | 12 +++ plugin/users.php | 34 --------- plugin/varnish.php | 29 -------- plugin/vmem.json | 27 +++++++ plugin/vmem.php | 58 --------------- plugin/vserver.json | 84 +++++++++++++++++++++ plugin/vserver.php | 122 ------------------------------ plugin/wireless.json | 35 +++++++++ plugin/wireless.php | 29 -------- plugin/zfs_arc.php | 97 ------------------------ 92 files changed, 1957 insertions(+), 2784 deletions(-) delete mode 100644 plugin/aggregation.php create mode 100644 plugin/apache.json delete mode 100644 plugin/apache.php create mode 100644 plugin/apcups.json delete mode 100644 plugin/apcups.php create mode 100644 plugin/battery.json delete mode 100644 plugin/battery.php delete mode 100644 plugin/bind.php create mode 100644 plugin/conntrack.json delete mode 100644 plugin/conntrack.php create mode 100644 plugin/contextswitch.json delete mode 100644 plugin/contextswitch.php create mode 100644 plugin/cpu.json delete mode 100644 plugin/cpu.php create mode 100644 plugin/cpufreq.json delete mode 100644 plugin/cpufreq.php delete mode 100644 plugin/dbi.php create mode 100644 plugin/df.json delete mode 100644 plugin/df.php create mode 100644 plugin/disk.json delete mode 100644 plugin/disk.php create mode 100644 plugin/dns.json delete mode 100644 plugin/dns.php create mode 100644 plugin/entropy.json delete mode 100644 plugin/entropy.php create mode 100644 plugin/filecount.json delete mode 100644 plugin/filecount.php create mode 100644 plugin/hddtemp.json delete mode 100644 plugin/hddtemp.php create mode 100644 plugin/interface.json delete mode 100644 plugin/interface.php delete mode 100644 plugin/ip6tables.php create mode 100644 plugin/ipmi.json delete mode 100644 plugin/ipmi.php create mode 100644 plugin/iptables.json delete mode 100644 plugin/iptables.php create mode 100644 plugin/irq.json delete mode 100644 plugin/irq.php create mode 100644 plugin/libvirt.json delete mode 100644 plugin/libvirt.php create mode 100644 plugin/load.json delete mode 100644 plugin/load.php create mode 100644 plugin/md.json delete mode 100644 plugin/md.php create mode 100644 plugin/memcached.json delete mode 100644 plugin/memcached.php create mode 100644 plugin/memory.json delete mode 100644 plugin/memory.php create mode 100644 plugin/mysql.json delete mode 100644 plugin/mysql.php create mode 100644 plugin/netlink.json delete mode 100644 plugin/netlink.php create mode 100644 plugin/nfs.json delete mode 100644 plugin/nfs.php create mode 100644 plugin/nginx.json delete mode 100644 plugin/nginx.php create mode 100644 plugin/ntpd.json delete mode 100644 plugin/ntpd.php create mode 100644 plugin/nut.json delete mode 100644 plugin/nut.php create mode 100644 plugin/openvpn.json delete mode 100644 plugin/openvpn.php create mode 100644 plugin/ping.json delete mode 100644 plugin/ping.php create mode 100644 plugin/postgresql.json delete mode 100644 plugin/postgresql.php delete mode 100644 plugin/powerdns.php create mode 100644 plugin/processes.json delete mode 100644 plugin/processes.php create mode 100644 plugin/sensors.json delete mode 100644 plugin/sensors.php create mode 100644 plugin/snmp.json delete mode 100644 plugin/snmp.php create mode 100644 plugin/swap.json delete mode 100644 plugin/swap.php delete mode 100644 plugin/tail.php create mode 100644 plugin/tcpconns.json delete mode 100644 plugin/tcpconns.php create mode 100644 plugin/thermal.json delete mode 100644 plugin/thermal.php create mode 100644 plugin/uptime.json delete mode 100644 plugin/uptime.php create mode 100644 plugin/users.json delete mode 100644 plugin/users.php delete mode 100644 plugin/varnish.php create mode 100644 plugin/vmem.json delete mode 100644 plugin/vmem.php create mode 100644 plugin/vserver.json delete mode 100644 plugin/vserver.php create mode 100644 plugin/wireless.json delete mode 100644 plugin/wireless.php delete mode 100644 plugin/zfs_arc.php (limited to 'plugin') diff --git a/plugin/aggregation.php b/plugin/aggregation.php deleted file mode 100644 index 0d28fae..0000000 --- a/plugin/aggregation.php +++ /dev/null @@ -1,46 +0,0 @@ -data_sources = array('value'); - $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); - $obj->legend = array( - 'idle' => 'Idle', - 'nice' => 'Nice', - 'user' => 'User', - 'wait' => 'Wait-IO', - 'system' => 'System', - 'softirq' => 'SoftIRQ', - 'interrupt' => 'IRQ', - 'steal' => 'Steal', - ); - $obj->colors = array( - 'idle' => 'e8e8e8', - 'nice' => '00e000', - 'user' => '0000ff', - 'wait' => 'ffb000', - 'system' => 'ff0000', - 'softirq' => 'ff00ff', - 'interrupt' => 'a000a0', - 'steal' => '000000', - ); - $obj->rrd_title = 'CPU usage'; - $obj->rrd_title = sprintf('CPU usage (%s)', $pi[1]); - $obj->rrd_vertical = 'Jiffies'; - $obj->rrd_format = '%7.2lf'; - $obj->rrdtool_opts .= ' -u 100'; - - $obj->rrd_graph(); - break; -} diff --git a/plugin/apache.json b/plugin/apache.json new file mode 100644 index 0000000..3774371 --- /dev/null +++ b/plugin/apache.json @@ -0,0 +1,143 @@ +{ + "apache_bytes": { + "title": "Webserver Traffic ({{PI}})", + "vertical": "{{ND}}/s", + "legend": { + "value": { + "name": "Traffic", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf" + }, + "apache_connections": { + "title": "Webserver Connections ({{PI}})", + "vertical": "Conns/s", + "legend": { + "value": { + "name": "Conns/s", + "color": "00b000" + } + }, + "legend_format": "%5.1lf" + }, + "apache_idle_workers": { + "title": "Webserver Idle Workers ({{PI}})", + "vertical": "Workers", + "legend": { + "value": { + "name": "Workers", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf" + }, + "apache_requests": { + "title": "Webserver Requests ({{PI}})", + "vertical": "Requests/s", + "legend": { + "value": { + "name": "Requests/s", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf" + }, + "apache_scoreboard": { + "title": "Webserver Scoreboard ({{PI}})", + "vertical": "Slots", + "type": "stacked", + "legend": { + "open": { + "name": "Open (empty)", + "color": "e0e0e0" + }, + "idle_cleanup": { + "name": "Idle cleanup", + "color": "ffff00" + }, + "finishing": { + "name": "Finishing", + "color": "008080" + }, + "logging": { + "name": "Logging", + "color": "a000a0" + }, + "closing": { + "name": "Closing", + "color": "000080" + }, + "dnslookup": { + "name": "DNS Lookup", + "color": "ff0000" + }, + "keepalive": { + "name": "Keepalive", + "color": "0080ff" + }, + "sending": { + "name": "Sending reply", + "color": "00e000" + }, + "reading": { + "name": "Reading request", + "color": "0000ff" + }, + "starting": { + "name": "Starting up", + "color": "ff00ff" + }, + "waiting": { + "name": "Waiting", + "color": "ffb000" + }, + + "connect": { + "name": "Connect (empty)", + "color": "e0e0e0" + }, + "hard_error": { + "name": "Hard error", + "color": "ff0000" + }, + "close": { + "name": "Close", + "color": "008080" + }, + "response_end": { + "name": "Request end", + "color": "a000a0" + }, + "write": { + "name": "Write", + "color": "000080" + }, + "response_start": { + "name": "Response start", + "color": "ffff00" + }, + "handle_request": { + "name": "Handle request", + "color": "0080ff" + }, + "read_post": { + "name": "Read POST", + "color": "00e000" + }, + "request_end": { + "name": "Request end", + "color": "0000ff" + }, + "read": { + "name": "Read", + "color": "ff00ff" + }, + "request_start": { + "name": "Request start", + "color": "ffb000" + } + }, + "legend_format": "%5.2lf" + } +} diff --git a/plugin/apache.php b/plugin/apache.php deleted file mode 100644 index 6fa9963..0000000 --- a/plugin/apache.php +++ /dev/null @@ -1,167 +0,0 @@ -args['type']) { - case 'apache_bytes': - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => sprintf('%s/s', ucfirst($CONFIG['network_datasize'])), - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Webserver Traffic%s', - !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = sprintf('%s/s', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; - case 'apache_connections': - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'Conns/s', - ); - $obj->colors = array( - 'value' => '00b000', - ); - $obj->rrd_title = sprintf('Webserver Connections%s', - !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = 'Conns/s'; - break; - case 'apache_idle_workers': - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'Workers', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Webserver Idle Workers%s', - !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = 'Workers'; - break; - case 'apache_requests': - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'Requests/s', - ); - $obj->colors = array( - 'value' => '00b000', - ); - $obj->rrd_title = sprintf('Webserver Requests%s', - !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = 'Requests/s'; - break; - case 'apache_scoreboard': - require_once 'type/GenericStacked.class.php'; - $obj = new Type_GenericStacked($CONFIG, $_GET); - $obj->data_sources = array('value'); - $obj->order = array( - 'open', - 'idle_cleanup', - 'finishing', - 'logging', - 'closing', - 'dnslookup', - 'keepalive', - 'sending', - 'reading', - 'starting', - 'waiting', - - 'connect', - 'hard_error', - 'close', - 'response_end', - 'write', - 'response_start', - 'handle_request', - 'read_post', - 'request_end', - 'read', - 'request_start', - ); - $obj->legend = array( - 'open' => 'Open (empty)', - 'waiting' => 'Waiting', - 'starting' => 'Starting up', - 'reading' => 'Reading request', - 'sending' => 'Sending reply', - 'keepalive' => 'Keepalive', - 'dnslookup' => 'DNS Lookup', - 'closing' => 'Closing', - 'logging' => 'Logging', - 'finishing' => 'Finishing', - 'idle_cleanup' => 'Idle cleanup', - - 'connect' => 'Connect (empty)', - 'close' => 'Close', - 'hard_error' => 'Hard error', - 'read' => 'Read', - 'read_post' => 'Read POST', - 'write' => 'Write', - 'handle_request' => 'Handle request', - 'request_start' => 'Request start', - 'request_end' => 'Request end', - 'response_start' => 'Response start', - 'response_end' => 'Response end', - ); - $obj->colors = array( - 'open' => 'e0e0e0', - 'waiting' => 'ffb000', - 'starting' => 'ff00ff', - 'reading' => '0000ff', - 'sending' => '00e000', - 'keepalive' => '0080ff', - 'dnslookup' => 'ff0000', - 'closing' => '000080', - 'logging' => 'a000a0', - 'finishing' => '008080', - 'idle_cleanup' => 'ffff00', - - 'connect' => 'e0e0e0', - 'close' => '008080', - 'hard_error' => 'ff0000', - 'read' => 'ff00ff', - 'read_post' => '00e000', - 'write' => '000080', - 'handle_request' => '0080ff', - 'request_start' => 'ffb000', - 'request_end' => '0000ff', - 'response_start' => 'ffff00', - 'response_end' => 'a000a0', - ); - $obj->rrd_title = sprintf('Webserver Scoreboard%s', - !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = 'Slots'; - break; -} - -$obj->rrd_format = '%5.1lf'; - -# backwards compatibility -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('count'); - if (count($obj->legend) == 1) { - $obj->legend['count'] = $obj->legend['value']; - unset($obj->legend['value']); - } - if (count($obj->colors) == 1) { - $obj->colors['count'] = $obj->colors['value']; - unset($obj->colors['value']); - } -} - -$obj->rrd_graph(); diff --git a/plugin/apcups.json b/plugin/apcups.json new file mode 100644 index 0000000..87ba662 --- /dev/null +++ b/plugin/apcups.json @@ -0,0 +1,67 @@ +{ + "charge": { + "title": "UPS Charge", + "vertical": "Ampere hours", + "legend": { + "value": { + "name": "Charge", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "frequency": { + "title": "UPS Input Frequency", + "vertical": "Hertz", + "legend": { + "value": { + "name": "Frequency", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "percent": { + "title": "UPS Load", + "vertical": "Load", + "legend": { + "value": { + "name": "Percent", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "temperature": { + "title": "UPS Temperature", + "vertical": "Celsius", + "legend": { + "value": { + "name": "Temperature", + "color": "0000f0" + } + } + }, + "timeleft": { + "title": "UPS Time Left", + "vertical": "Seconds", + "legend": { + "value": { + "name": "Time Left", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "voltage": { + "title": "UPS Voltage {{TI}}", + "vertical": "Volt", + "legend": { + "value": { + "name": "Voltage", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/apcups.php b/plugin/apcups.php deleted file mode 100644 index 853f0ed..0000000 --- a/plugin/apcups.php +++ /dev/null @@ -1,89 +0,0 @@ -args['type']) { - case 'charge': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Charge'); - $obj->colors = array('value' => '0000f0'); - $obj->rrd_title = sprintf('UPS Charge'); - $obj->rrd_vertical = 'Ampere hours'; - break; - case 'frequency': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Input Frequency'); - $obj->colors = array('value' => '0000f0'); - $obj->rrd_title = sprintf('UPS Input Frequency'); - $obj->rrd_vertical = 'Hertz'; - break; - case 'percent': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Load'); - $obj->colors = array('value' => '0000f0'); - $obj->rrd_title = sprintf('UPS Load'); - $obj->rrd_vertical = 'Percent'; - break; - case 'temperature': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Temperature'); - $obj->colors = array('value' => '0000f0'); - $obj->rrd_title = sprintf('UPS Temperature'); - $obj->rrd_vertical = 'Celsius'; - break; - case 'timeleft': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Time Left'); - $obj->colors = array('value' => '0000f0'); - $obj->rrd_title = sprintf('UPS Time Left'); - $obj->rrd_vertical = 'Seconds'; - break; - case 'voltage': - $obj->order = array('battery', 'input', 'output'); - $obj->legend = array( - 'battery' => 'Battery Voltage', - 'input' => 'Input Voltage', - 'output' => 'Output Voltage' - ); - $obj->colors = array( - 'battery' => '0000f0', - 'input' => '00f000', - 'output' => 'f00000' - ); - $obj->rrd_title = sprintf('UPS Voltage'); - $obj->rrd_vertical = 'Volt'; - break; -} -$obj->rrd_format = '%5.1lf%s'; - -# backwards compatibility -if ($CONFIG['version'] < 5 && - in_array($obj->args['type'], array('frequency', 'percent', 'timeleft'))) { - - $obj->data_sources = array($obj->args['type']); - - $obj->legend[$obj->args['type']] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors[$obj->args['type']] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); - diff --git a/plugin/battery.json b/plugin/battery.json new file mode 100644 index 0000000..625e704 --- /dev/null +++ b/plugin/battery.json @@ -0,0 +1,35 @@ +{ + "charge": { + "title": "Charge (Battery {{PI}})", + "vertical": "Ampere hours", + "legend": { + "value": { + "name": "Charge", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "current": { + "title": "Current (Battery {{PI}})", + "vertical": "Ampere", + "legend": { + "value": { + "name": "Current", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + }, + "voltage": { + "title": "Voltage (Battery {{PI}})", + "vertical": "Volt", + "legend": { + "value": { + "name": "Voltage", + "color": "0000f0" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/battery.php b/plugin/battery.php deleted file mode 100644 index fc91955..0000000 --- a/plugin/battery.php +++ /dev/null @@ -1,38 +0,0 @@ -colors = array( - 'value' => '0000f0', -); -switch($obj->args['type']) { - case 'charge': - $obj->legend = array('value' => 'Charge'); - $obj->rrd_title = sprintf('Charge (Battery %s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Ampere hours'; - break; - case 'current': - $obj->legend = array('value' => 'Current'); - $obj->rrd_title = sprintf('Current (Battery %s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Ampere'; - break; - case 'voltage': - $obj->legend = array('value' => 'Voltage'); - $obj->rrd_title = sprintf('Voltage (Battery %s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Volt'; - break; -} -$obj->rrd_format = '%4.1lf'; - -$obj->rrd_graph(); - diff --git a/plugin/bind.php b/plugin/bind.php deleted file mode 100644 index cfbd4c6..0000000 --- a/plugin/bind.php +++ /dev/null @@ -1,14 +0,0 @@ -rrd_title = sprintf('%s/%s', $obj->args['pinstance'], $obj->args['type']); -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/conntrack.json b/plugin/conntrack.json new file mode 100644 index 0000000..d3e218e --- /dev/null +++ b/plugin/conntrack.json @@ -0,0 +1,13 @@ +{ + "conntrack": { + "title": "Conntrack entries", + "vertical": "Entries", + "legend": { + "value": { + "name": "Entries", + "color": "0000f0" + } + }, + "legend_format": "%.1lf" + } +} diff --git a/plugin/conntrack.php b/plugin/conntrack.php deleted file mode 100644 index efd562c..0000000 --- a/plugin/conntrack.php +++ /dev/null @@ -1,35 +0,0 @@ -data_sources = array('value'); -$obj->legend = array( - 'value' => 'Conntrack entries', -); -$obj->colors = array( - 'value' => '0000f0', -); -$obj->rrd_title = 'Conntrack entries'; -$obj->rrd_vertical = '#'; -$obj->rrd_format = '%.1lf'; - -# backwards compatibility -# the data source is named 'entropy' in collectd's types.db -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('entropy'); - - $obj->legend['entropy'] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors['entropy'] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); diff --git a/plugin/contextswitch.json b/plugin/contextswitch.json new file mode 100644 index 0000000..65c3745 --- /dev/null +++ b/plugin/contextswitch.json @@ -0,0 +1,13 @@ +{ + "contextswitch": { + "title": "Context switches", + "vertical": "switch per second Bits", + "legend": { + "value": { + "name": "Switches", + "color": "0000f0" + } + }, + "legend_format": "%4.0lf" + } +} diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php deleted file mode 100644 index 24ba7f2..0000000 --- a/plugin/contextswitch.php +++ /dev/null @@ -1,34 +0,0 @@ -data_sources = array('value'); -$obj->legend = array( - 'value' => 'Context switches', -); -$obj->colors = array( - 'value' => '0000f0', -); -$obj->rrd_title = 'Context switches'; -$obj->rrd_vertical = 'switch per second Bits'; -$obj->rrd_format = '%4.0lf'; - -# backwards compatibility -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('contextswitches'); - - $obj->legend['contextswitches'] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors['contextswitches'] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); diff --git a/plugin/cpu.json b/plugin/cpu.json new file mode 100644 index 0000000..50254f8 --- /dev/null +++ b/plugin/cpu.json @@ -0,0 +1,43 @@ +{ + "cpu": { + "title": "CPU-{{PI}} usage", + "vertical": "Jiffies", + "rrdtool_opts": "-u 100", + "type": "stacked", + "legend": { + "idle": { + "name": "Idle", + "color": "e8e8e8" + }, + "nice": { + "name": "Nice", + "color": "00e000" + }, + "user": { + "name": "User", + "color": "0000ff" + }, + "wait": { + "name": "Wait-IO", + "color": "ffb000" + }, + "system": { + "name": "System", + "color": "ff0000" + }, + "softirq": { + "name": "SoftIRQ", + "color": "ff00ff" + }, + "interrupt": { + "name": "IRQ", + "color": "a000a0" + }, + "steal": { + "name": "Steal", + "color": "000000" + } + }, + "legend_format": "%5.2lf" + } +} diff --git a/plugin/cpu.php b/plugin/cpu.php deleted file mode 100644 index 2965c9e..0000000 --- a/plugin/cpu.php +++ /dev/null @@ -1,48 +0,0 @@ -data_sources = array('value'); -$obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); -$obj->legend = array( - 'idle' => 'Idle', - 'nice' => 'Nice', - 'user' => 'User', - 'wait' => 'Wait-IO', - 'system' => 'System', - 'softirq' => 'SoftIRQ', - 'interrupt' => 'IRQ', - 'steal' => 'Steal', -); -$obj->colors = array( - 'idle' => 'e8e8e8', - 'nice' => '00e000', - 'user' => '0000ff', - 'wait' => 'ffb000', - 'system' => 'ff0000', - 'softirq' => 'ff00ff', - 'interrupt' => 'a000a0', - 'steal' => '000000', -); - -$obj->rrd_title = sprintf('CPU-%s usage', $obj->args['pinstance']); -$obj->rrd_vertical = 'Jiffies'; -$obj->rrd_format = '%5.2lf'; -$obj->rrdtool_opts .= ' -u 100'; - -$obj->rrd_graph(); diff --git a/plugin/cpufreq.json b/plugin/cpufreq.json new file mode 100644 index 0000000..c66f924 --- /dev/null +++ b/plugin/cpufreq.json @@ -0,0 +1,7 @@ +{ + "cpufreq": { + "title": "CPU frequency scaling", + "vertical": "Hz", + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/cpufreq.php b/plugin/cpufreq.php deleted file mode 100644 index d9542d1..0000000 --- a/plugin/cpufreq.php +++ /dev/null @@ -1,17 +0,0 @@ -data_sources = array('value'); -$obj->rrd_title = 'CPU frequency scaling'; -$obj->rrd_vertical = 'Hz'; -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/dbi.php b/plugin/dbi.php deleted file mode 100644 index b9dd268..0000000 --- a/plugin/dbi.php +++ /dev/null @@ -1,16 +0,0 @@ -rrd_title = sprintf('%s', $obj->args['pinstance'], $obj->args['type']); -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/df.json b/plugin/df.json new file mode 100644 index 0000000..8820b89 --- /dev/null +++ b/plugin/df.json @@ -0,0 +1,42 @@ +{ + "df_complex": { + "title": "Free space ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "reserved": { + "name": "Reserved", + "color": "aaaaaa" + }, + "free": { + "name": "Free", + "color": "00ff00" + }, + "used": { + "name": "Used", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%sB" + }, + "df_inodes": { + "title": "Free inodes ({{PI}})", + "vertical": "Inodes", + "type": "stacked", + "legend": { + "reserved": { + "name": "Reserved", + "color": "aaaaaa" + }, + "free": { + "name": "Free", + "color": "00ff00" + }, + "used": { + "name": "Used", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/df.php b/plugin/df.php deleted file mode 100644 index 2c0dfd8..0000000 --- a/plugin/df.php +++ /dev/null @@ -1,48 +0,0 @@ -data_sources = array('value'); -$obj->order = array('reserved', 'free', 'used'); -$obj->legend = array( - 'reserved' => 'Reserved', - 'free' => 'Free', - 'used' => 'Used', -); -$obj->colors = array( - 'reserved' => 'aaaaaa', - 'free' => '00ff00', - 'used' => 'ff0000', -); - -switch($obj->args['type']) { - case 'df_complex': - default: - $obj->rrd_title = sprintf('Free space (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%sB'; - break; - case 'df_inodes': - $obj->rrd_title = sprintf('Free inodes (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Inodes'; - $obj->rrd_format = '%5.1lf%s'; - break; -} - -# backwards compatibility -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('free', 'used'); - $obj->rrd_title = sprintf('Free space (%s)', $obj->args['tinstance']); -} - -$obj->rrd_graph(); diff --git a/plugin/disk.json b/plugin/disk.json new file mode 100644 index 0000000..2d14715 --- /dev/null +++ b/plugin/disk.json @@ -0,0 +1,67 @@ +{ + "disk_merged": { + "title": "Disk Merged Operations ({{PI}})", + "vertical": "Merged operations/s", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "disk_octets": { + "title": "Disk Traffic ({{PI}})", + "vertical": "Bytes per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "disk_ops": { + "title": "Disk Operations ({{PI}})", + "vertical": "Ops per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "disk_time": { + "title": "Disk time per operation ({{PI}})", + "vertical": "Avg. Time/Op", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%ss", + "scale": 0.001 + } +} diff --git a/plugin/disk.php b/plugin/disk.php deleted file mode 100644 index 28f5eac..0000000 --- a/plugin/disk.php +++ /dev/null @@ -1,49 +0,0 @@ -data_sources = array('read', 'write'); -$obj->legend = array( - 'read' => 'Read', - 'write' => 'Written', -); -$obj->colors = array( - 'read' => '0000ff', - 'write' => '00b000', -); -switch($obj->args['type']) { - case 'disk_merged': - $obj->rrd_title = sprintf('Disk Merged Operations (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Merged operations/s'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'disk_octets': - $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes per second'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'disk_ops': - $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Ops per second'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'disk_time': - $obj->rrd_title = sprintf('Disk time per operation (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Avg. Time/Op'; - $obj->rrd_format = '%5.1lf%ss'; - $obj->scale = '0.001'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/dns.json b/plugin/dns.json new file mode 100644 index 0000000..6f8c542 --- /dev/null +++ b/plugin/dns.json @@ -0,0 +1,32 @@ +{ + "dns_octets": { + "title": "DNS traffic", + "vertical": "Bit/s", + "type": "stacked", + "legend": { + "queries": { + "name": "Queries", + "color": "0000ff" + }, + "responses": { + "name": "Responses", + "color": "00ff00" + } + } + }, + "dns_opcode": { + "title": "DNS Opcode Query", + "vertical": "Queries/s", + "type": "stacked" + }, + "dns_qtype": { + "title": "DNS QType", + "vertical": "Queries/s", + "type": "stacked" + }, + "dns_rcode": { + "title": "DNS Reply code", + "vertical": "Queries/s", + "type": "stacked" + } +} diff --git a/plugin/dns.php b/plugin/dns.php deleted file mode 100644 index 0c44097..0000000 --- a/plugin/dns.php +++ /dev/null @@ -1,51 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'dns_octets': - $obj->data_sources = array( - 'queries', - 'responses', - ); - $obj->legend = array( - 'queries' => 'Queries', - 'responses' => 'Responses', - ); - $obj->colors = array( - 'queries' => '0000ff', - 'responses' => '00ff00', - ); - $obj->rrd_title = 'DNS traffic'; - $obj->rrd_vertical = 'Bit/s'; - break; - case 'dns_opcode': - $obj->data_sources = array('value'); - $obj->rrd_title = 'DNS Opcode Query'; - $obj->rrd_vertical = 'Queries/s'; - break; - case 'dns_qtype': - $obj->data_sources = array('value'); - $obj->rrd_title = 'DNS QType'; - $obj->rrd_vertical = 'Queries/s'; - break; - case 'dns_rcode': - $obj->data_sources = array('value'); - $obj->rrd_title = 'DNS Reply code'; - $obj->rrd_vertical = 'Queries/s'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/entropy.json b/plugin/entropy.json new file mode 100644 index 0000000..dc0171d --- /dev/null +++ b/plugin/entropy.json @@ -0,0 +1,13 @@ +{ + "entropy": { + "title": "Available entropy", + "vertical": "Bits", + "legend": { + "value": { + "name": "Entropy bits", + "color": "0000f0" + } + }, + "legend_format": "%4.0lf" + } +} diff --git a/plugin/entropy.php b/plugin/entropy.php deleted file mode 100644 index 0170335..0000000 --- a/plugin/entropy.php +++ /dev/null @@ -1,34 +0,0 @@ -data_sources = array('value'); -$obj->legend = array( - 'value' => 'Entropy bits', -); -$obj->colors = array( - 'value' => '0000f0', -); -$obj->rrd_title = 'Available entropy'; -$obj->rrd_vertical = 'Bits'; -$obj->rrd_format = '%4.0lf'; - -# backwards compatibility -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('entropy'); - - $obj->legend['entropy'] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors['entropy'] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); diff --git a/plugin/filecount.json b/plugin/filecount.json new file mode 100644 index 0000000..b32fbdd --- /dev/null +++ b/plugin/filecount.json @@ -0,0 +1,26 @@ +{ + "bytes": { + "title": "Filecount: size ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "Size", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "files": { + "title": "Filecount: number of files ({{PI}})", + "vertical": "Files", + "type": "stacked", + "legend": { + "value": { + "name": "Files", + "color": "f0a000" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/filecount.php b/plugin/filecount.php deleted file mode 100644 index ead8df8..0000000 --- a/plugin/filecount.php +++ /dev/null @@ -1,33 +0,0 @@ -rrd_format = '%5.1lf%s'; -$obj->data_sources = array('value'); - -switch($obj->args['type']) { - case 'bytes': - $obj->legend = array('value' => 'Size'); - $obj->colors = array('value' => '0000ff'); - $obj->rrd_title = sprintf('Filecount: size (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - case 'files': - $obj->legend = array('value' => 'Files'); - $obj->colors = array('value' => 'f0a000'); - $obj->rrd_title = sprintf('Filecount: number of files (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Files'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/hddtemp.json b/plugin/hddtemp.json new file mode 100644 index 0000000..20b8d61 --- /dev/null +++ b/plugin/hddtemp.json @@ -0,0 +1,7 @@ +{ + "temperature": { + "title": "HDD Temperature", + "vertical": "°C", + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/hddtemp.php b/plugin/hddtemp.php deleted file mode 100644 index 9e88b6a..0000000 --- a/plugin/hddtemp.php +++ /dev/null @@ -1,17 +0,0 @@ -.rrd - -$obj = new Type_Default($CONFIG, $_GET); -$obj->legend = array('temperature' => 'Temperature'); -$obj->rrd_title = 'HDD Temperature'; -$obj->rrd_vertical = '°C'; -$obj->rrd_format = '%.1lf'; - -$obj->rrd_graph(); diff --git a/plugin/interface.json b/plugin/interface.json new file mode 100644 index 0000000..9b23049 --- /dev/null +++ b/plugin/interface.json @@ -0,0 +1,51 @@ +{ + "if_octets": { + "title": "Interface Traffic ({{PI}})", + "vertical": "{{ND}} per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + }, + "if_errors": { + "title": "Interface Errors ({{PI}})", + "vertical": "Errors per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_packets": { + "title": "Interface Packets ({{PI}})", + "vertical": "Packets per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/interface.php b/plugin/interface.php deleted file mode 100644 index 5728c07..0000000 --- a/plugin/interface.php +++ /dev/null @@ -1,48 +0,0 @@ -data_sources = array('rx', 'tx'); -$obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', -); -$obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', -); -$obj->rrd_format = '%5.1lf%s'; - -$instance = $CONFIG['version'] < 5 ? 'tinstance' : 'pinstance'; -switch($obj->args['type']) { - case 'if_errors': - $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args[$instance]); - $obj->rrd_vertical = 'Errors per second'; - break; - case 'if_octets': - $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args[$instance]); - $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; - case 'if_packets': - $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args[$instance]); - $obj->rrd_vertical = 'Packets per second'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/ip6tables.php b/plugin/ip6tables.php deleted file mode 100644 index 090c475..0000000 --- a/plugin/ip6tables.php +++ /dev/null @@ -1,26 +0,0 @@ -data_sources = array('value'); -switch($_GET['t']) { - case 'ipt_bytes': - $obj->rrd_title = 'Bytes'; - break; - case 'ipt_packets': - $obj->rrd_title = 'Packets'; - break; - } -$obj->rrd_vertical = ''; -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/ipmi.json b/plugin/ipmi.json new file mode 100644 index 0000000..bd860dd --- /dev/null +++ b/plugin/ipmi.json @@ -0,0 +1,17 @@ +{ + "fanspeed": { + "title": "Fanspeed ({{PI}})", + "vertical": "RPM", + "legend_format": "%5.1lf" + }, + "temerature": { + "title": "Temperature ({{PI}})", + "vertical": "Celsius", + "legend_format": "%5.1lf%s" + }, + "voltage": { + "title": "Voltage ({{PI}})", + "vertical": "Volt", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/ipmi.php b/plugin/ipmi.php deleted file mode 100644 index 5593daf..0000000 --- a/plugin/ipmi.php +++ /dev/null @@ -1,43 +0,0 @@ -legend = array( - 'value' => 'Value', -); -switch($obj->args['type']) { - case 'fanspeed': - $obj->rrd_title = sprintf('Fanspeed (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'RPM'; - $obj->rrd_format = '%5.1lf'; - break; - case 'temperature': - $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Celsius'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'voltage': - $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Volt'; - $obj->rrd_format = '%5.1lf'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/iptables.json b/plugin/iptables.json new file mode 100644 index 0000000..ba2945f --- /dev/null +++ b/plugin/iptables.json @@ -0,0 +1,15 @@ +{ + "ipt_bytes": { + "title": "IP-Tables Traffic", + "vertical": "{{ND}}", + "type": "stacked", + "legend_format": "%5.1lf%s", + "datasize": true + }, + "ipt_packets": { + "title": "IP-Tables Packets", + "vertical": "Packets", + "type": "stacked", + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/iptables.php b/plugin/iptables.php deleted file mode 100644 index e60d2dc..0000000 --- a/plugin/iptables.php +++ /dev/null @@ -1,26 +0,0 @@ -data_sources = array('value'); -switch($_GET['t']) { - case 'ipt_bytes': - $obj->rrd_title = 'Bytes'; - break; - case 'ipt_packets': - $obj->rrd_title = 'Packets'; - break; - } -$obj->rrd_vertical = ''; -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/irq.json b/plugin/irq.json new file mode 100644 index 0000000..b45c043 --- /dev/null +++ b/plugin/irq.json @@ -0,0 +1,8 @@ +{ + "irq": { + "type": "stacked", + "title": "Interrupts", + "vertical": "IRQs/s", + "legend_format": "%6.1lf" + } +} diff --git a/plugin/irq.php b/plugin/irq.php deleted file mode 100644 index 6cd87f9..0000000 --- a/plugin/irq.php +++ /dev/null @@ -1,18 +0,0 @@ -rrd_title = 'Interrupts'; -$obj->rrd_vertical = 'IRQs/s'; -$obj->rrd_format = '%6.1lf'; - -$obj->rrd_graph(); diff --git a/plugin/libvirt.json b/plugin/libvirt.json new file mode 100644 index 0000000..9329a8a --- /dev/null +++ b/plugin/libvirt.json @@ -0,0 +1,115 @@ +{ + "disk_octets": { + "title": "Disk Traffic ({{TI}})", + "vertical": "Bytes per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "disk_ops": { + "title": "Disk Operations ({{TI}})", + "vertical": "Ops per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_dropped": { + "title": "Interface Packets Dropped ({{TI}})", + "vertical": "Packets/s", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_errors": { + "title": "Interface Errors ({{TI}})", + "vertical": "Errors/s", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_octets": { + "title": "Interface Traffic ({{TI}})", + "vertical": "{{ND}} per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + }, + "if_packets": { + "title": "Interface Packets ({{TI}})", + "vertical": "Packets per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "virt_cpu_total": { + "title": "CPU usage", + "vertical": "CPU time", + "legend": { + "value": { + "name": "CPU time", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf" + }, + "virt_vcpu": { + "title": "vCPU usage", + "vertical": "vCPU time", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/libvirt.php b/plugin/libvirt.php deleted file mode 100644 index bcaeeb9..0000000 --- a/plugin/libvirt.php +++ /dev/null @@ -1,144 +0,0 @@ -args['type']) { - case 'disk_octets': - $obj->data_sources = array('read', 'write'); - $obj->legend = array( - 'read' => 'Read', - 'write' => 'Written', - ); - $obj->colors = array( - 'read' => '0000ff', - 'write' => '00b000', - ); - $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = 'Bytes per second'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'disk_ops': - $obj->data_sources = array('read', 'write'); - $obj->legend = array( - 'read' => 'Read', - 'write' => 'Written', - ); - $obj->colors = array( - 'read' => '0000ff', - 'write' => '00b000', - ); - $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = 'Ops per second'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'if_dropped': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Packets Dropped (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = 'Packets dropped per second'; - break; - case 'if_errors': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = 'Errors per second'; - break; - case 'if_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; - case 'if_packets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = 'Packets per second'; - break; - case 'virt_cpu_total': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'CPU time', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = 'CPU usage'; - $obj->rrd_vertical = 'CPU time'; - break; - case 'virt_vcpu': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'VCPU time', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = 'VCPU usage'; - $obj->rrd_vertical = 'VCPU time'; - break; -} - -$obj->rrd_format = '%5.1lf%s'; - -if ($CONFIG['version'] < 5 && count($obj->data_sources) == 1) { - $obj->data_sources = array('ns'); - - $obj->legend['ns'] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors['ns'] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); diff --git a/plugin/load.json b/plugin/load.json new file mode 100644 index 0000000..4166087 --- /dev/null +++ b/plugin/load.json @@ -0,0 +1,22 @@ +{ + "load": { + "title": "System load", + "vertical": "System load", + "type": "default", + "legend": { + "shortterm": { + "name": " 1 min", + "color": "00ff00" + }, + "midterm": { + "name": " 5 min", + "color": "0000ff" + }, + "longterm": { + "name": "15 min", + "color": "ff0000" + } + }, + "legend_format": "%.2lf" + } +} diff --git a/plugin/load.php b/plugin/load.php deleted file mode 100644 index 78520c5..0000000 --- a/plugin/load.php +++ /dev/null @@ -1,27 +0,0 @@ -data_sources = array('shortterm', 'midterm', 'longterm'); -$obj->legend = array( - 'shortterm' => ' 1 min', - 'midterm' => ' 5 min', - 'longterm' => '15 min', -); -$obj->colors = array( - 'shortterm' => '00ff00', - 'midterm' => '0000ff', - 'longterm' => 'ff0000', -); -$obj->rrd_title = 'System load'; -$obj->rrd_vertical = 'System load'; -$obj->rrd_format = '%.2lf'; - -$obj->rrd_graph(); diff --git a/plugin/md.json b/plugin/md.json new file mode 100644 index 0000000..6e0812c --- /dev/null +++ b/plugin/md.json @@ -0,0 +1,7 @@ +{ + "md_disks": { + "title": "MD (md-{{PI}})", + "vertical": "Disks", + "legend_format": "%2.0lf" + } +} diff --git a/plugin/md.php b/plugin/md.php deleted file mode 100644 index 9d09efe..0000000 --- a/plugin/md.php +++ /dev/null @@ -1,20 +0,0 @@ -legend = array( - 'value' => 'Value', -); -$obj->rrd_title = sprintf('Disks (md-%s)', $obj->args['pinstance']); -$obj->rrd_vertical = '#'; -$obj->rrd_format = '%2.0lf'; - -$obj->rrd_graph(); diff --git a/plugin/memcached.json b/plugin/memcached.json new file mode 100644 index 0000000..0e7e0fd --- /dev/null +++ b/plugin/memcached.json @@ -0,0 +1,134 @@ +{ + "df": { + "title": "Memcached Memory Usage", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "free": { + "name": "Free", + "color": "00ff00" + }, + "used": { + "name": "Used", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "memcached_command": { + "title": "Memcached Commands", + "vertical": "Commands", + "type": "stacked", + "legend": { + "flush": { + "name": "Flush", + "color": "00e000" + }, + "get": { + "name": "Get", + "color": "0000ff" + }, + "set": { + "name": "Set", + "color": "ffb000" + } + }, + "legend_format": "%5.1lf%s" + }, + "memcached_connections": { + "title": "Memcached Number of Connections", + "vertical": "Connections", + "legend": { + "value": { + "name": "Connections", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "memcached_items": { + "title": "Number of Items in Memcached", + "vertical": "Items", + "legend": { + "value": { + "name": "Items", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "memcached_octets": { + "title": "Memcached Network Traffic", + "vertical": "{{ND}}", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + }, + "memcached_ops": { + "title": "Memcached Operations", + "vertical": "Commands", + "type": "stacked", + "legend": { + "evictions": { + "name": "Evictions", + "color": "00e000" + }, + "hits": { + "name": "Hits", + "color": "0000ff" + }, + "misses": { + "name": "Misses", + "color": "ffb000" + } + }, + "legend_format": "%5.1lf%s" + }, + "percent": { + "title": "Memcached Hit Ratio", + "vertical": "Percent", + "legend": { + "value": { + "name": "Percent", + "color": "00e000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_count": { + "title": "Memcached number of Threads", + "vertical": "Threads", + "legend": { + "value": { + "name": "Threads", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_cputime": { + "title": "CPU Time consumed by Memcached", + "vertical": "CPU Time", + "legend": { + "user": { + "name": "User", + "color": "00e000" + }, + "syst": { + "name": "System", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/memcached.php b/plugin/memcached.php deleted file mode 100644 index 62eebfd..0000000 --- a/plugin/memcached.php +++ /dev/null @@ -1,179 +0,0 @@ -data_sources = array('used', 'free'); - $obj->order = array('used', 'free'); - $obj->legend = array( - 'used' => 'Used', - 'free' => 'Free', - ); - $obj->colors = array( - 'used' => '00e000', - 'free' => '0000ff', - ); - $obj->rrd_title = 'Memcached Memory Usage'; - $obj->rrd_vertical = 'bytes'; - break; - -# memcached_command-(flush|get|set).rrd - case 'memcached_command': - require_once 'type/GenericStacked.class.php'; - $obj = new Type_GenericStacked($CONFIG, $_GET); - $obj->order = array('flush', 'get', 'set'); - $obj->legend = array( - 'flush' => 'Flush', - 'get' => 'Get', - 'set' => 'Set', - ); - $obj->colors = array( - 'flush' => '00e000', - 'get' => '0000ff', - 'set' => 'ffb000', - ); - $obj->rrd_title = 'Memcached Commands'; - $obj->rrd_vertical = 'Commands'; - break; - -# memcached_connections-current.rrd - case 'memcached_connections': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'Connections', - ); - $obj->colors = array( - 'percent' => '00b000', - ); - $obj->rrd_title = 'Memcached Number of Connections'; - $obj->rrd_vertical = 'Connections'; - break; - -# memcached_items-current.rrd - case 'memcached_items': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('value'); - $obj->legend = array( - 'value ' => 'Items', - ); - $obj->colors = array( - 'value' => '00b000', - ); - $obj->rrd_title = 'Number of Items in Memcached'; - $obj->rrd_vertical = 'Items'; - break; - -# memcached_octets.rrd - case 'memcached_octets': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('rx', 'tx'); - $obj->order = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = 'Memcached Network Traffic'; - $obj->rrd_vertical = ucfirst($CONFIG['network_datasize']); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; -# memcached_ops-(evictions|hits|misses).rrd - case 'memcached_ops': - require_once 'type/GenericStacked.class.php'; - $obj = new Type_GenericStacked($CONFIG, $_GET); - $obj->order = array('evictions', 'hits', 'misses'); - $obj->legend = array( - 'evictions' => 'Evictions', - 'hits' => 'Hits', - 'misses' => 'Misses', - ); - $obj->colors = array( - 'evictions' => '00e000', - 'hits' => '0000ff', - 'misses' => 'ffb000', - ); - $obj->rrd_title = 'Memcached Operations'; - $obj->rrd_vertical = 'Commands'; - break; - -# percent-hitratio.rrd - case 'percent': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('percent'); - $obj->legend = array( - 'percent ' => 'Percentage', - ); - $obj->colors = array( - 'percent' => '00e000', - ); - $obj->rrd_title = 'Memcached Hits/Gets Ratio'; - $obj->rrd_vertical = 'Percent'; - break; -# ps_count.rrd - case 'ps_count': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('threads'); - $obj->order = array('threads'); - $obj->legend = array( - 'threads' => 'Threads', - ); - $obj->colors = array( - 'threads' => '00b000', - ); - $obj->rrd_title = 'Memcached number of Threads'; - $obj->rrd_vertical = 'Threads'; - break; - -# ps_cputime.rrd - case 'ps_cputime': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->data_sources = array('user', 'syst'); - $obj->order = array('user', 'syst'); - $obj->legend = array( - 'user' => 'User', - 'syst' => 'System', - ); - $obj->colors = array( - 'user' => '00e000', - 'syst' => '0000ff', - ); - $obj->rrd_title = 'CPU Time consumed by the memcached process'; - $obj->rrd_vertical = 'Time'; - break; -} - -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/memory.json b/plugin/memory.json new file mode 100644 index 0000000..5921c3b --- /dev/null +++ b/plugin/memory.json @@ -0,0 +1,41 @@ +{ + "memory": { + "title": "Physical memory utilization", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "free": { + "name": "Free", + "color": "00e000" + }, + "inactive": { + "name": "Inactive", + "color": "00b000" + }, + "cached": { + "name": "Cached", + "color": "0000ff" + }, + "buffered": { + "name": "Buffered", + "color": "ffb000" + }, + "locked": { + "name": "Locked", + "color": "ff00ff" + }, + "used": { + "name": "Used", + "color": "ff0000" + }, + "active": { + "name": "Active", + "color": "ff00ff" + }, + "wired": { + "name": "Wired", + "color": "ff0000" + } + } + } +} diff --git a/plugin/memory.php b/plugin/memory.php deleted file mode 100644 index 0a1fe68..0000000 --- a/plugin/memory.php +++ /dev/null @@ -1,44 +0,0 @@ -order = array('free', 'inactive', 'buffered', 'cached', 'cache', 'locked', 'used', 'active', 'wired'); -$obj->legend = array( - 'free' => 'Free', - 'inactive' => 'Inactive', - 'cached' => 'Cached', - 'cache' => 'Cache', - 'buffered' => 'Buffered', - 'locked' => 'Locked', - 'used' => 'Used', - 'active' => 'Active', - 'wired' => 'Wired', -); -$obj->colors = array( - 'free' => '00e000', - 'inactive' => '00b000', - 'cached' => '0000ff', - 'cache' => '0000ff', - 'buffered' => 'ffb000', - 'locked' => 'ff00ff', - 'used' => 'ff0000', - 'active' => 'ff00ff', - 'wired' => 'ff0000', -); - -$obj->rrd_title = 'Physical memory utilization'; -$obj->rrd_vertical = 'Bytes'; -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/mysql.json b/plugin/mysql.json new file mode 100644 index 0000000..e4dd6fc --- /dev/null +++ b/plugin/mysql.json @@ -0,0 +1,143 @@ +{ + "cache_result": { + "title": "MySQL query cache ({{PI}})", + "vertical": "Queries/s", + "type": "stacked", + "legend": { + "qcache-not_cached": { + "name": "Not Cached", + "color": "f0a000" + }, + "qcache-inserts": { + "name": "Inserts", + "color": "0000ff" + }, + "qcache-hits": { + "name": "Hits", + "color": "00e000" + }, + "qcache-prunes": { + "name": "Lowmem Prunes", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "cache_size": { + "title": "MySQL query cache size ({{PI}})", + "vertical": "Queries in cache", + "type": "stacked", + "legend": { + "value": { + "name": "Queries" + } + }, + "legend_format": "%5.1lf%s" + }, + "mysql_commands": { + "title": "MySQL commands ({{PI}})", + "vertical": "Issues/s", + "type": "stacked", + "legend_format": "%5.1lf%s" + }, + "mysql_handler": { + "title": "MySQL handler ({{PI}})", + "vertical": "Invocations", + "type": "stacked", + "legend": { + "commit": { + "color": "ff0000" + }, + "delete": { + "color": "ff00e7" + }, + "read_first": { + "color": "cc00ff" + }, + "read_key": { + "color": "3200ff" + }, + "read_next": { + "color": "0065ff" + }, + "read_prev": { + "color": "00fff3" + }, + "read_rnd": { + "color": "00ff65" + }, + "read_rnd_next": { + "color": "33ff00" + }, + "update": { + "color": "cbff00" + }, + "write": { + "color": "ff9800" + }, + "rollback": { + "color": "000000" + } + }, + "legend_format": "%5.1lf%s" + }, + "mysql_locks": { + "title": "MySQL locks ({{PI}})", + "vertical": "locks", + "legend": { + "immediate": { + "color": "ff0000" + }, + "waited": { + "color": "00ff00" + } + }, + "legend_format": "%5.1lf%s" + }, + "mysql_octets": { + "title": "MySQL Traffic ({{TI}})", + "vertical": "Bits per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "threads": { + "title": "MySQL threads ({{PI}})", + "vertical": "Threads", + "type": "stacked", + "legend": { + "cached": { + "name": "Cached", + "color": "00e000" + }, + "connected": { + "name": "Connected", + "color": "0000ff" + }, + "running": { + "name": "Running", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "total_threads": { + "title": "MySQL created threads ({{PI}})", + "vertical": "Created Threads", + "legend": { + "value": { + "name": "Created" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/mysql.php b/plugin/mysql.php deleted file mode 100644 index 880b8c0..0000000 --- a/plugin/mysql.php +++ /dev/null @@ -1,140 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) -{ - case 'cache_result': - $obj->legend = array( - 'qcache-not_cached' => 'Not Cached', - 'qcache-inserts' => 'Inserts', - 'qcache-hits' => 'Hits', - 'qcache-prunes' => 'Lowmem Prunes', - ); - $obj->colors = array( - 'qcache-not_cached' => 'f0a000', - 'qcache-inserts' => '0000ff', - 'qcache-hits' => '00e000', - 'qcache-prunes' => 'ff0000', - ); - $obj->rrd_title = sprintf('MySQL query cache (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Queries/s'; - break; - case 'cache_size': - $obj->legend = array( - 'qcache' => 'Queries', - ); - $obj->rrd_title = sprintf('MySQL query cache size (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Queries in cache'; - break; - case 'mysql_commands': - $obj->rrd_title = sprintf('MySQL commands (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Issues/s'; - break; - case 'mysql_handler': - $obj->order = array('commit', 'delete', 'read_first', 'read_key', 'read_next', 'read_prev', 'read_rnd', 'read_rnd_next', 'update', 'write', 'rollback'); - $obj->colors = array( - 'commit' => 'ff0000', - 'delete' => 'ff00e7', - 'read_first' => 'cc00ff', - 'read_key' => '3200ff', - 'read_next' => '0065ff', - 'read_prev' => '00fff3', - 'read_rnd' => '00ff65', - 'read_rnd_next' => '33ff00', - 'update' => 'cbff00', - 'write' => 'ff9800', - 'rollback' => '000000', - ); - $obj->rrd_title = sprintf('MySQL handler (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Invocations'; - break; - case 'mysql_locks': - $obj->colors = array( - 'immediate' => 'ff0000', - 'waited' => '00ff00', - ); - $obj->rrd_title = sprintf('MySQL locks (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'locks'; - break; - case 'mysql_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('MySQL traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bits per second'; - break; - case 'threads': - $obj->legend = array( - 'cached' => 'Cached', - 'connected' => 'Connected', - 'running' => 'Running', - ); - $obj->colors = array( - 'cached' => '00e000', - 'connected' => '0000ff', - 'running' => 'ff0000', - ); - $obj->rrd_title = sprintf('MySQL threads (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Threads'; - break; - case 'total_threads': - $obj->legend = array( - 'created' => 'Created', - ); - $obj->rrd_title = sprintf('MySQL created threads (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Created Threads'; - break; - # mysql_qcache is removed since commit collectd-4.10.0-104-g9ae3541 - case 'mysql_qcache': - $obj->data_sources = array('not_cached', 'inserts', 'hits', 'lowmem_prunes', 'queries_in_cache'); - $obj->legend = array( - 'not_cached' => 'Not Cached', - 'inserts' => 'Inserts', - 'hits' => 'Hits', - 'lowmem_prunes' => 'Lowmem Prunes', - 'queries_in_cache' => 'Queries in Cache', - ); - $obj->colors = array( - 'not_cached' => 'f0a000', - 'inserts' => '0000ff', - 'hits' => '00e000', - 'lowmem_prunes' => 'ff0000', - 'queries_in_cache' => 'cccccc', - ); - $obj->rrd_title = sprintf('MySQL query cache (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Queries/s'; - break; - # mysql_threads is removed since commit collectd-4.10.0-105-g6c48fca - case 'mysql_threads': - $obj->data_sources = array('cached', 'connected', 'running', 'created'); - $obj->legend = array( - 'cached' => 'Cached', - 'connected' => 'Connected', - 'running' => 'Running', - 'created' => 'Created', - ); - $obj->colors = array( - 'cached' => '00e000', - 'connected' => '0000ff', - 'running' => 'ff0000', - 'created' => 'cccccc', - ); - $obj->rrd_title = sprintf('MySQL threads (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Threads'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/netlink.json b/plugin/netlink.json new file mode 100644 index 0000000..79fbd8e --- /dev/null +++ b/plugin/netlink.json @@ -0,0 +1,151 @@ +{ + "if_collisions": { + "title": "Collisions ({{PI}})", + "vertical": "Collisions/s", + "type": "stacked", + "legend": { + "value": { + "name": "Collisions" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_dropped": { + "title": "Dropped Packets ({{PI}})", + "vertical": "Packets/s", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_errors": { + "title": "Interface Errors ({{PI}})", + "vertical": "Errors/s", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_multicast": { + "title": "Multicast Packets ({{PI}})", + "vertical": "Packets/s", + "type": "stacked", + "legend": { + "value": { + "name": "Packets", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_octets": { + "title": "Interface Traffic ({{PI}})", + "vertical": "{{ND}}/second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + }, + "if_packets": { + "title": "Interface Packets ({{PI}})", + "vertical": "Packets/s", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_rx_errors": { + "title": "Interface receive errors ({{PI}})", + "vertical": "Errors/s", + "type": "stacked", + "legend": { + "crc": { + "name": "CRC", + "color": "00e000" + }, + "fifo": { + "name": "FiFo", + "color": "f000c0" + }, + "frame": { + "name": "Frame", + "color": "ffb000" + }, + "length": { + "name": "Lenght", + "color": "f00000" + }, + "missed": { + "name": "Missed", + "color": "0000f0" + }, + "over": { + "name": "Over", + "color": "00e0ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_tx_errors": { + "title": "Interface transmit errors ({{PI}})", + "vertical": "Errors/s", + "type": "stacked", + "legend": { + "aborted": { + "name": "Aborted", + "color": "f00000" + }, + "carrier": { + "name": "Carrier", + "color": "00e0ff" + }, + "fifo": { + "name": "FiFo", + "color": "00e000" + }, + "heartbeat": { + "name": "Heartbeat", + "color": "ffb000" + }, + "window": { + "name": "Window", + "color": "f000c0" + } + }, + "legend_format": "%5.1lf%s" + } +} + diff --git a/plugin/netlink.php b/plugin/netlink.php deleted file mode 100644 index 9ddaee8..0000000 --- a/plugin/netlink.php +++ /dev/null @@ -1,122 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'if_collisions': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Collisions'); - $obj->colors = array('value' => '0000ff'); - $obj->rrd_title = sprintf('Collisions (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Collisions/s'; - break; - case 'if_dropped': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Dropped Packets (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Packets/s'; - break; - case 'if_errors': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Errors/s'; - break; - case 'if_multicast': - $obj->data_sources = array('value'); - $obj->legend = array('value' => 'Packets'); - $obj->colors = array('value' => '0000ff'); - $obj->rrd_title = sprintf('Multicast Packets (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Packets/s'; - break; - case 'if_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = sprintf('%s/s', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; - case 'if_packets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Packets/s'; - break; - case 'if_rx_errors': - $obj->data_sources = array('value'); - $obj->legend = array( - 'crc' => 'CRC', - 'fifo' => 'FiFo', - 'frame' => 'Frame', - 'length' => 'Lenght', - 'missed' => 'Missed', - 'over' => 'Over', - ); - $obj->colors = array( - 'crc' => '00e000', - 'fifo' => 'f000c0', - 'frame' => 'ffb000', - 'length' => 'f00000', - 'missed' => '0000f0', - 'over' => '00e0ff', - ); - $obj->rrd_title = sprintf('Interface receive errors (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Errors/s'; - break; - case 'if_tx_errors': - $obj->data_sources = array('value'); - $obj->legend = array( - 'aborted' => 'Aborted', - 'carrier' => 'Carrier', - 'fifo' => 'FiFo', - 'heartbeat'=> 'Heartbeat', - 'window' => 'Window', - ); - $obj->colors = array( - 'aborted' => 'f00000', - 'carrier' => '00e0ff', - 'fifo' => '00e000', - 'heartbeat'=> 'ffb000', - 'window' => 'f000c0', - ); - $obj->rrd_title = sprintf('Interface transmit errors (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Errors/s'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/nfs.json b/plugin/nfs.json new file mode 100644 index 0000000..372d222 --- /dev/null +++ b/plugin/nfs.json @@ -0,0 +1,8 @@ +{ + "nfs_procedure": { + "title": "NFS-{{PI}} Procedures", + "vertical": "Procedures", + "type": "stacked", + "legend_format": "%5.2lf" + } +} diff --git a/plugin/nfs.php b/plugin/nfs.php deleted file mode 100644 index 612580c..0000000 --- a/plugin/nfs.php +++ /dev/null @@ -1,31 +0,0 @@ -data_sources = array('value'); -switch($obj->args['pinstance']) { - case 'v2client': - $obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write'); - break; - - case 'v3client': - $obj->order = array('access', 'commit', 'create', 'fsinfo', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'mknod', 'null', 'pathconf', 'read', 'readdir', 'readdirplus', 'readlink', 'remove', 'rename', 'rmdir', 'setattr', 'symlink', 'write'); - break; -} - - -$obj->rrd_title = sprintf('NFS-%s Procedures', $obj->args['pinstance']); -$obj->rrd_vertical = 'Procedures'; -$obj->rrd_format = '%5.2lf'; - -$obj->rrd_graph(); diff --git a/plugin/nginx.json b/plugin/nginx.json new file mode 100644 index 0000000..08e1d40 --- /dev/null +++ b/plugin/nginx.json @@ -0,0 +1,51 @@ +{ + "connections": { + "title": "Nginx connections", + "vertical": "Connections/s", + "legend": { + "accepted": { + "name": "Accepted", + "color": "ff0000" + }, + "handled": { + "name": "Handled", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "nginx_connections": { + "title": "Nginx connection states", + "vertical": "Connections/s", + "legend": { + "active": { + "name": "Active", + "color": "005d57" + }, + "reading": { + "name": "Reading", + "color": "4444ff" + }, + "waiting": { + "name": "Waiting", + "color": "f24ac8" + }, + "writing": { + "name": "Writing", + "color": "00cf00" + } + }, + "legend_format": "%5.1lf%s" + }, + "nginx_requests": { + "title": "Nginx requests", + "vertical": "Requests/s", + "legend": { + "value": { + "name": "Requests", + "color": "00aa00" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/nginx.php b/plugin/nginx.php deleted file mode 100644 index cbb0fa4..0000000 --- a/plugin/nginx.php +++ /dev/null @@ -1,66 +0,0 @@ -args['type']) -{ - case 'connections': - $obj->order = array('accepted', 'handled'); - $obj->legend = array( - 'accepted' => 'Accepted', - 'handled' => 'Handled', - ); - $obj->colors = array( - 'accepted' => 'ff0000', - 'handled' => '0000ff', - ); - $obj->rrd_title = sprintf('nginx connections'); - $obj->rrd_vertical = 'Connections/s'; - break; - case 'nginx_connections': - $obj->order = array('active', 'reading', 'waiting', 'writing'); - $obj->legend = array( - 'active' => 'Active', - 'reading' => 'Reading', - 'waiting' => 'Waiting', - 'writing' => 'Writing', - ); - $obj->colors = array( - 'active' => '005d57', - 'reading' => '4444ff', - 'waiting' => 'f24ac8', - 'writing' => '00cf00', - ); - $obj->rrd_title = sprintf('nginx connections'); - $obj->rrd_vertical = 'Connections/s'; - break; - case 'nginx_requests': - $obj->legend = array( - 'value' => 'Requests', - ); - $obj->colors = array( - 'value' => '00aa00', - ); - $obj->rrd_title = sprintf('nginx requests'); - $obj->rrd_vertical = 'Requests per second'; - break; -} - -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/ntpd.json b/plugin/ntpd.json new file mode 100644 index 0000000..f7ec918 --- /dev/null +++ b/plugin/ntpd.json @@ -0,0 +1,22 @@ +{ + "delay": { + "title": "Delay", + "vertical": "Seconds", + "legend_format": "%5.1lf%s" + }, + "frequency_offset": { + "title": "Frequency offset", + "vertical": "ppm", + "legend_format": "%5.1lf%s" + }, + "time_dispersion": { + "title": "Time dispersion", + "vertical": "Seconds", + "legend_format": "%5.1lf%s" + }, + "time_offset": { + "title": "Time offset", + "vertical": "Seconds", + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/ntpd.php b/plugin/ntpd.php deleted file mode 100644 index ceea1db..0000000 --- a/plugin/ntpd.php +++ /dev/null @@ -1,48 +0,0 @@ -.rrd -# ntpd/frequency_offset-loop.rrd -# ntpd/time_dispersion-.rrd -# ntpd/time_offset-.rrd - -$obj = new Type_Default($CONFIG, $_GET); -$obj->legend = array('ping' => 'Ping time', - 'ping_stddev' => 'Ping stddev', - 'ping_droprate' => 'Ping droprate'); -$obj->rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'delay': - if ($CONFIG['version'] < 5) - $obj->data_sources = array('seconds'); - $obj->rrd_title = sprintf('Delay'); - $obj->rrd_vertical = 'Seconds'; - break; - case 'frequency_offset': - if ($CONFIG['version'] < 5) - $obj->data_sources = array('ppm'); - $obj->rrd_title = 'Frequency offset'; - $obj->rrd_vertical = 'ppm'; - break; - case 'time_dispersion': - if ($CONFIG['version'] < 5) - $obj->data_sources = array('seconds'); - $obj->rrd_title = 'Time dispersion'; - $obj->rrd_vertical = 'Seconds'; - break; - case 'time_offset': - if ($CONFIG['version'] < 5) - $obj->data_sources = array('seconds'); - $obj->rrd_title = 'Time offset'; - $obj->rrd_vertical = 'Seconds'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/nut.json b/plugin/nut.json new file mode 100644 index 0000000..c5bcbca --- /dev/null +++ b/plugin/nut.json @@ -0,0 +1,32 @@ +{ + "frequency": { + "title": "Frequency ({{PI}})", + "vertical": "Hz", + "legend_format": "%5.1lf%s" + }, + "percent": { + "title": "Charge & load ({{PI}})", + "vertical": "Percent", + "legend_format": "%5.1lf" + }, + "power": { + "title": "Power ({{PI}})", + "vertical": "VA", + "legend_format": "%5.1lf%s" + }, + "temperature": { + "title": "Temperature ({{PI}})", + "vertical": "°C", + "legend_format": "%5.1lf%s" + }, + "timeleft": { + "title": "Time Left ({{PI}})", + "vertical": "Seconds", + "legend_format": "%5.1lf" + }, + "voltage": { + "title": "Voltage {{PI}}", + "vertical": "Voltage", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/nut.php b/plugin/nut.php deleted file mode 100644 index eb2ceb2..0000000 --- a/plugin/nut.php +++ /dev/null @@ -1,77 +0,0 @@ -args['type']) { - case 'frequency': - if ($CONFIG['version'] < 5) { - $obj->data_sources = array('frequency'); - } else { - $obj->data_sources = array('value'); - } - $obj->legend = array('output' => 'Output'); - $obj->rrd_title = sprintf('Frequency (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Hz'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'percent': - if ($CONFIG['version'] < 5) { - $obj->data_sources = array('percent'); - } else { - $obj->data_sources = array('value'); - } - $obj->legend = array('charge' => 'Charge', - 'load' => 'Load'); - $obj->rrd_title = sprintf('Charge & load (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = '%'; - $obj->rrd_format = '%5.1lf'; - break; - case 'power': - $obj->data_sources = array('value'); - $obj->legend = array('ups' => 'UPS'); - $obj->rrd_title = sprintf('Power (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'VA'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'temperature': - $obj->data_sources = array('value'); - $obj->legend = array('battery' => 'Battery'); - $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = '°C'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'timeleft': - if ($CONFIG['version'] < 5) { - $obj->data_sources = array('timeleft'); - } else { - $obj->data_sources = array('value'); - } - $obj->legend = array('timeleft' => 'Timeleft'); - $obj->rrd_title = sprintf('Timeleft (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Seconds'; - $obj->rrd_format = '%5.1lf'; - break; - case 'voltage': - $obj->data_sources = array('value'); - $obj->legend = array('battery' => 'Battery', - 'input' => 'Input', - 'output' => 'Output'); - $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Volts'; - $obj->rrd_format = '%5.1lf'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/openvpn.json b/plugin/openvpn.json new file mode 100644 index 0000000..aa731c4 --- /dev/null +++ b/plugin/openvpn.json @@ -0,0 +1,30 @@ +{ + "if_octets": { + "title": "Traffic ({{PI}})", + "vertical": "{{ND}} per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + }, + "users": { + "title": "Users ({{PI}})", + "vertical": "Users", + "legend": { + "value": { + "name": "Users", + "color": "0000f0" + } + }, + "legend_format": "%.1lf" + } +} diff --git a/plugin/openvpn.php b/plugin/openvpn.php deleted file mode 100644 index 6eba3d5..0000000 --- a/plugin/openvpn.php +++ /dev/null @@ -1,42 +0,0 @@ -data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'users': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->legend = array( - 'value' => 'Users', - ); - $obj->rrd_title = sprintf('Users (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Users'; - $obj->rrd_format = '%.1lf'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/ping.json b/plugin/ping.json new file mode 100644 index 0000000..ba6d67e --- /dev/null +++ b/plugin/ping.json @@ -0,0 +1,16 @@ +{ + "ping": { + "title": "Ping latency", + "vertical": "Milliseconds", + "legend_format": "%5.1lf" + }, + "ping_stddev": { + "title": "Ping standard deviation", + "vertical": "Milliseconds", + "legend_format": "%5.1lf" + }, + "ping_droprate": { + "title": "Ping droprate", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/ping.php b/plugin/ping.php deleted file mode 100644 index ca2920c..0000000 --- a/plugin/ping.php +++ /dev/null @@ -1,37 +0,0 @@ -.rrd -# ping/ping_stddev-.rrd -# ping/ping_droprate-.rrd - -$obj = new Type_Default($CONFIG, $_GET); -$obj->data_sources = array('value'); -$obj->legend = array('ping' => 'Ping time', - 'ping_stddev' => 'Ping stddev', - 'ping_droprate' => 'Ping droprate'); -$obj->rrd_format = '%5.1lf'; - -switch($obj->args['type']) { - case 'ping': - if ($CONFIG['version'] < 5) - $obj->data_sources = array('ping'); - $obj->rrd_title = 'Ping latency'; - $obj->rrd_vertical = 'Milliseconds'; - break; - case 'ping_stddev': - $obj->rrd_title = 'Ping standard deviation'; - $obj->rrd_vertical = 'Milliseconds'; - break; - case 'ping_droprate': - $obj->rrd_title = 'Ping droprate'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/postgresql.json b/plugin/postgresql.json new file mode 100644 index 0000000..4e0181d --- /dev/null +++ b/plugin/postgresql.json @@ -0,0 +1,134 @@ +{ + "pg_blks": { + "title": "PostgreSQL Disk I/O ({{PI}})", + "vertical": "Blocks", + "type": "stacked", + "legend": { + "heap_hit": { + "name": "Heap hit" + }, + "heap_read": { + "name": "Heap read" + }, + "idx_hit": { + "name": "Index hit" + }, + "idx_read": { + "name": "Index read" + }, + "tidx_hit": { + "name": "Toast index hit" + }, + "tidx_read": { + "name": "Toast index read" + }, + "toast_hit": { + "name": "Toast hit" + }, + "toast_read": { + "name": "Toast read" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_db_size": { + "title": "PostgreSQL DB size ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "Size", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_n_tup_c": { + "title": "PostgreSQL Row actions ({{PI}})", + "vertical": "Rows", + "type": "stacked", + "legend": { + "ins": { + "name": "Insert", + "color": "00ff00" + }, + "upd": { + "name": "Update", + "color": "ff7c00" + }, + "hot_upd": { + "name": "Hot Update", + "color": "0000ff" + }, + "del": { + "name": "Delete", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_n_tup_g": { + "title": "PostgreSQL Table states ({{PI}})", + "vertical": "Rows", + "type": "stacked", + "legend": { + "live": { + "name": "Live", + "color": "00ff00" + }, + "dead": { + "name": "Dead", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_numbackends": { + "title": "PostgreSQL Backends ({{PI}})", + "vertical": "Backends", + "type": "stacked", + "legend": { + "value": { + "name": "Backends", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_scan": { + "title": "PostgreSQL Scans ({{PI}})", + "vertical": "Scans / Rows", + "type": "stacked", + "legend": { + "seq": { + "name": "Sequential" + }, + "seq_tup_read": { + "name": "Sequential rows" + }, + "idx": { + "name": "Index" + }, + "idx_tup_fetch": { + "name": "Index Rows" + } + }, + "legend_format": "%5.1lf%s" + }, + "pg_xact": { + "title": "PostgreSQL Transactions ({{PI}})", + "vertical": "Transactions", + "type": "stacked", + "legend": { + "commit": { + "name": "Commit", + "color": "00ff00" + }, + "rollback": { + "name": "Rollback", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf" + } +} diff --git a/plugin/postgresql.php b/plugin/postgresql.php deleted file mode 100644 index 4cfae41..0000000 --- a/plugin/postgresql.php +++ /dev/null @@ -1,130 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'pg_blks': - $obj->legend = array( - 'heap_hit' => 'Heap hit', - 'heap_read' => 'Heap read', - 'idx_hit' => 'Index hit', - 'idx_read' => 'Index read', - 'tidx_hit' => 'Toast index hit', - 'tidx_read' => 'Toast index read', - 'toast_hit' => 'Toast hit', - 'toast_read' => 'Toast read', - ); - $obj->rrd_title = sprintf('PostgreSQL Disk I/O (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Blocks'; - break; - case 'pg_db_size': - $obj->legend = array( - 'value' => 'Size', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('PostgreSQL DB size (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Bytes'; - break; - case 'pg_n_tup_c': - $obj->order = array( - 'ins', - 'upd', - 'hot_upd', - 'del', - ); - $obj->legend = array( - 'ins' => 'Insert', - 'upd' => 'Update', - 'hot_upd' => 'Hot Update', - 'del' => 'Delete', - ); - $obj->colors = array( - 'ins' => '00ff00', - 'upd' => 'ff7c00', - 'hot_upd' => '0000ff', - 'del' => 'ff0000', - ); - $obj->rrd_title = sprintf('PostgreSQL Row actions (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Rows'; - break; - case 'pg_n_tup_g': - $obj->order = array('live', 'dead'); - $obj->legend = array( - 'live' => 'Live', - 'dead' => 'Dead', - ); - $obj->colors = array( - 'live' => '00ff00', - 'dead' => 'ff0000', - ); - $obj->rrd_title = sprintf('PostgreSQL Table states (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Rows'; - break; - case 'pg_numbackends': - $obj->legend = array( - 'value' => 'Backends', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('PostgreSQL Backends (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Number'; - break; - case 'pg_scan': - $obj->legend = array( - 'seq' => 'Sequential', - 'seq_tup_read' => 'Sequential rows', - 'idx' => 'Index', - 'idx_tup_fetch' => 'Index Rows', - ); - $obj->rrd_title = sprintf('PostgreSQL Scans (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Scans / Rows'; - break; - case 'pg_xact': - $obj->legend = array( - 'commit' => 'Commit', - 'rollback' => 'Rollback', - ); - $obj->colors = array( - 'commit' => '00ff00', - 'rollback' => 'ff0000', - ); - $obj->rrd_title = sprintf('PostgreSQL Transactions (%s)', - !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Transactions'; - break; - default: - $obj->rrd_title = sprintf('%s/%s', $obj->args['pinstance'], $obj->args['type']); - break; -} - -$obj->rrd_graph(); diff --git a/plugin/powerdns.php b/plugin/powerdns.php deleted file mode 100644 index d83d67b..0000000 --- a/plugin/powerdns.php +++ /dev/null @@ -1,14 +0,0 @@ -rrd_title = sprintf('PowerDNS %s (%s)', $obj->args['type'], $obj->args['pinstance']); -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/processes.json b/plugin/processes.json new file mode 100644 index 0000000..9ffca72 --- /dev/null +++ b/plugin/processes.json @@ -0,0 +1,186 @@ +{ + "ps_state": { + "title": "Processes", + "vertical": "Processes", + "type": "stacked", + "legend": { + "blocked": { + "name": "Blocked", + "color": "ff00ff" + }, + "paging": { + "name": "Paging", + "color": "ffb000" + }, + "running": { + "name": "Running", + "color": "00e000" + }, + "sleeping": { + "name": "Sleeping", + "color": "0000ff" + }, + "stopped": { + "name": "Stopped", + "color": "a000a0" + }, + "zombies": { + "name": "Zombies", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "fork_rate": { + "title": "Fork rate", + "vertical": "forks/s", + "type": "stacked", + "legend": { + "value": { + "name": "Forks", + "color": "f0a000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_code": { + "title": "Text Resident Set ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "TRS", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_count": { + "title": "Number of Processes/Threads ({{PI}})", + "vertical": "Amount", + "type": "stacked", + "legend": { + "processes": { + "name": "Processes", + "color": "0000ff" + }, + "threads": { + "name": "Threads", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_cputime": { + "title": "CPU time ({{PI}})", + "vertical": "CPU time [s]", + "type": "stacked", + "legend": { + "user": { + "name": "User", + "color": "0000ff" + }, + "syst": { + "name": "System", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_disk_octets": { + "title": "Disk Traffic ({{PI}})", + "vertical": "Bytes per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_disk_ops": { + "title": "Disk Operations ({{PI}})", + "vertical": "Ops per second", + "type": "io", + "legend": { + "read": { + "name": "Read", + "color": "0000ff" + }, + "write": { + "name": "Write", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_data": { + "title": "Data Resident Set ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "DRS", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_pagefaults": { + "title": "PageFaults ({{PI}})", + "vertical": "Pagefaults", + "type": "stacked", + "legend": { + "minflt": { + "name": "Minor", + "color": "ff0000" + }, + "majflt": { + "name": "Major", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_rss": { + "title": "Resident Segment Size ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "RSS", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_stacksize": { + "title": "Stacksize ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "Stacksize", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "ps_vm": { + "title": "Virtual Memory ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "value": { + "name": "Memory", + "color": "0000ff" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/processes.php b/plugin/processes.php deleted file mode 100644 index 27819cc..0000000 --- a/plugin/processes.php +++ /dev/null @@ -1,183 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) -{ - case 'ps_state': - $obj->legend = array( - 'paging' => 'Paging', - 'blocked' => 'Blocked', - 'zombies' => 'Zombies', - 'stopped' => 'Stopped', - 'running' => 'Running', - 'sleeping' => 'Sleeping', - ); - $obj->colors = array( - 'paging' => 'ffb000', - 'blocked' => 'ff00ff', - 'zombies' => 'ff0000', - 'stopped' => 'a000a0', - 'running' => '00e000', - 'sleeping' => '0000ff', - 'value' => 'f0a000', - ); - $obj->rrd_title = 'Processes'; - $obj->rrd_vertical = 'Processes'; - break; - - case 'fork_rate': - $obj->legend = array( - 'value' => 'Forks', - ); - $obj->colors = array( - 'value' => 'f0a000', - ); - $obj->rrd_title = 'Fork rate'; - $obj->rrd_vertical = 'forks/s'; - break; - - case 'ps_code': - $obj->legend = array( - 'value' => 'TRS', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Text Resident Set (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - - case 'ps_count': - $obj->data_sources = array('processes', 'threads'); - $obj->legend = array( - 'processes' => 'Processes', - 'threads' => 'Threads', - ); - $obj->colors = array( - 'processes' => '0000ff', - 'threads' => 'ff0000', - ); - $obj->rrd_title = sprintf('Number of Processes/Threads (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Amount'; - break; - - case 'ps_cputime': - $obj->data_sources = array('user', 'syst'); - $obj->legend = array( - 'user' => 'User', - 'syst' => 'System', - ); - $obj->colors = array( - 'user' => '0000ff', - 'syst' => 'ff0000', - ); - $obj->rrd_title = sprintf('CPU time (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'CPU time [s]'; - break; - - case 'ps_disk_octets': - $obj->data_sources = array('read', 'write'); - $obj->legend = array( - 'read' => 'Read', - 'write' => 'Write', - ); - $obj->colors = array( - 'read' => '0000ff', - 'write' => '00b000', - ); - $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes per second'; - break; - - case 'ps_disk_ops': - $obj->data_sources = array('read', 'write'); - $obj->legend = array( - 'read' => 'Read', - 'write' => 'Write', - ); - $obj->colors = array( - 'read' => '0000ff', - 'write' => '00b000', - ); - $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Ops per second'; - break; - - case 'ps_data': - $obj->legend = array( - 'value' => 'DRS', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Data Resident Set (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - - case 'ps_pagefaults': - $obj->data_sources = array('minflt', 'majflt'); - $obj->legend = array( - 'minflt' => 'Minor', - 'majflt' => 'Major', - ); - $obj->colors = array( - 'minflt' => 'ff0000', - 'majflt' => '0000ff', - ); - $obj->rrd_title = sprintf('PageFaults (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Pagefaults'; - break; - - case 'ps_rss': - $obj->legend = array( - 'value' => 'RSS', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Resident Segment Size (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - - case 'ps_stacksize': - $obj->legend = array( - 'value' => 'Stacksize', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Stacksize (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - - case 'ps_vm': - $obj->legend = array( - 'value' => 'Memory', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = sprintf('Virtual Memory (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - break; - -} - - -$obj->rrd_graph(); diff --git a/plugin/sensors.json b/plugin/sensors.json new file mode 100644 index 0000000..bd860dd --- /dev/null +++ b/plugin/sensors.json @@ -0,0 +1,17 @@ +{ + "fanspeed": { + "title": "Fanspeed ({{PI}})", + "vertical": "RPM", + "legend_format": "%5.1lf" + }, + "temerature": { + "title": "Temperature ({{PI}})", + "vertical": "Celsius", + "legend_format": "%5.1lf%s" + }, + "voltage": { + "title": "Voltage ({{PI}})", + "vertical": "Volt", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/sensors.php b/plugin/sensors.php deleted file mode 100644 index e0c0d9c..0000000 --- a/plugin/sensors.php +++ /dev/null @@ -1,36 +0,0 @@ -legend = array( - 'value' => 'Value', -); -switch($obj->args['type']) { - case 'fanspeed': - $obj->rrd_title = sprintf('Fanspeed (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'RPM'; - $obj->rrd_format = '%5.1lf'; - break; - case 'temperature': - $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Celsius'; - $obj->rrd_format = '%5.1lf%s'; - break; - case 'voltage': - $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Volt'; - $obj->rrd_format = '%5.1lf'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/snmp.json b/plugin/snmp.json new file mode 100644 index 0000000..9c6cc91 --- /dev/null +++ b/plugin/snmp.json @@ -0,0 +1,19 @@ +{ + "if_octets": { + "title": "Interface Traffic ({{TI}})", + "vertical": "{{ND}} per second", + "type": "io", + "legend": { + "rx": { + "name": "Receive", + "color": "0000ff" + }, + "tx": { + "name": "Transmit", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s", + "datasize": true + } +} diff --git a/plugin/snmp.php b/plugin/snmp.php deleted file mode 100644 index 4fbebbb..0000000 --- a/plugin/snmp.php +++ /dev/null @@ -1,35 +0,0 @@ -data_sources = array('rx', 'tx'); - $obj->legend = array( - 'rx' => 'Receive', - 'tx' => 'Transmit', - ); - $obj->colors = array( - 'rx' => '0000ff', - 'tx' => '00b000', - ); - $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); - $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - break; - default: - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG, $_GET); - $obj->rrd_title = sprintf('SNMP: %s (%s)', $obj->args['type'], $obj->args['tinstance']); - break; -} - -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); - diff --git a/plugin/swap.json b/plugin/swap.json new file mode 100644 index 0000000..8caa510 --- /dev/null +++ b/plugin/swap.json @@ -0,0 +1,38 @@ +{ + "swap": { + "title": "Swap utilization", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "free": { + "name": "Free", + "color": "00e000" + }, + "cached": { + "name": "Cached", + "color": "0000ff" + }, + "used": { + "name": "Used", + "color": "ff0000" + } + }, + "legend_format": "%5.1lf%s" + }, + "swap_io": { + "title": "Swapped I/O pages", + "vertical": "Pages", + "type": "io", + "legend": { + "out": { + "name": "Out", + "color": "0000ff" + }, + "in": { + "name": "In", + "color": "00b000" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/swap.php b/plugin/swap.php deleted file mode 100644 index 140772c..0000000 --- a/plugin/swap.php +++ /dev/null @@ -1,50 +0,0 @@ -order = array('free', 'cached', 'used'); - $obj->legend = array( - 'free' => 'Free', - 'cached' => 'Cached', - 'used' => 'Used', - ); - $obj->colors = array( - 'free' => '00e000', - 'cached' => '0000ff', - 'used' => 'ff0000', - ); - $obj->rrd_title = 'Swap utilization'; - $obj->rrd_vertical = 'Bytes'; - break; - case 'swap_io': - require_once 'type/GenericIO.class.php'; - $obj = new Type_GenericIO($CONFIG, $_GET); - $obj->order = array('out', 'in'); - $obj->legend = array( - 'out' => 'Out', - 'in' => 'In', - ); - $obj->colors = array( - 'out' => '0000ff', - 'in' => '00b000', - ); - $obj->rrd_title = 'Swapped I/O pages'; - $obj->rrd_vertical = 'Pages'; - break; -} - -$obj->rrd_format = '%5.1lf%s'; - -$obj->rrd_graph(); diff --git a/plugin/tail.php b/plugin/tail.php deleted file mode 100644 index 5698558..0000000 --- a/plugin/tail.php +++ /dev/null @@ -1,29 +0,0 @@ -rrd_title = sprintf('tail: %s (%s)', $obj->args['pinstance'], $obj->args['type']); -$obj->rrd_format = '%5.1lf%s'; - -# backwards compatibility -if ($CONFIG['version'] < 5) { - if (strcmp($obj->args['type'], 'gauge') != 0) { - $obj->data_sources = array('count'); - if (count($obj->legend) == 1) { - $obj->legend['count'] = $obj->legend['value']; - unset($obj->legend['value']); - } - if (count($obj->colors) == 1) { - $obj->colors['count'] = $obj->colors['value']; - unset($obj->colors['value']); - } - } -} - -$obj->rrd_graph(); diff --git a/plugin/tcpconns.json b/plugin/tcpconns.json new file mode 100644 index 0000000..7b436d9 --- /dev/null +++ b/plugin/tcpconns.json @@ -0,0 +1,8 @@ +{ + "tcp_connections": { + "title": "TCP Connections ({{TI}})", + "vertical": "Connections", + "type": "stacked", + "legend_format": "%5.1lf" + } +} diff --git a/plugin/tcpconns.php b/plugin/tcpconns.php deleted file mode 100644 index 5c629c5..0000000 --- a/plugin/tcpconns.php +++ /dev/null @@ -1,17 +0,0 @@ -rrd_title = sprintf('TCP Connections (%s)', $obj->args['pinstance']); -$obj->rrd_vertical = '#'; -$obj->rrd_format = '%5.1lf'; - -$obj->rrd_graph(); diff --git a/plugin/thermal.json b/plugin/thermal.json new file mode 100644 index 0000000..6f66a85 --- /dev/null +++ b/plugin/thermal.json @@ -0,0 +1,12 @@ +{ + "gauge": { + "title": "Temperature ({{PI}})", + "vertical": "°C", + "legend": { + "value": { + "name": "Temperature" + } + }, + "legend_format": "%.1lf" + } +} diff --git a/plugin/thermal.php b/plugin/thermal.php deleted file mode 100644 index 9f25787..0000000 --- a/plugin/thermal.php +++ /dev/null @@ -1,24 +0,0 @@ -legend = array( - 'value' => 'Temperature', -); -switch($obj->args['type']) { - case 'gauge': - $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = '°C'; - $obj->rrd_format = '%.1lf'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/uptime.json b/plugin/uptime.json new file mode 100644 index 0000000..c452913 --- /dev/null +++ b/plugin/uptime.json @@ -0,0 +1,14 @@ +{ + "uptime": { + "title": "Uptime", + "vertical": "Days", + "type": "uptime", + "legend": { + "value": { + "name": "Current", + "color": "00e000" + } + }, + "legend_format": ".1lf" + } +} diff --git a/plugin/uptime.php b/plugin/uptime.php deleted file mode 100644 index ca45d76..0000000 --- a/plugin/uptime.php +++ /dev/null @@ -1,23 +0,0 @@ -data_sources = array('value'); -$obj->legend = array( - 'value' => 'Current', -); -$obj->colors = array( - 'value' => '00e000', -); -$obj->rrd_title = 'Uptime'; -$obj->rrd_vertical = 'Days'; -$obj->rrd_format = '%.1lf'; - -$obj->rrd_graph(); diff --git a/plugin/users.json b/plugin/users.json new file mode 100644 index 0000000..8de437e --- /dev/null +++ b/plugin/users.json @@ -0,0 +1,12 @@ +{ + "users": { + "title": "Users", + "legend": { + "value": { + "name": "Users", + "color": "0000f0" + } + }, + "legend_format": "%.1lf" + } +} diff --git a/plugin/users.php b/plugin/users.php deleted file mode 100644 index f49de38..0000000 --- a/plugin/users.php +++ /dev/null @@ -1,34 +0,0 @@ -data_sources = array('value'); -$obj->legend = array( - 'value' => 'Users', -); -$obj->colors = array( - 'value' => '0000f0', -); -$obj->rrd_title = 'Users'; -$obj->rrd_vertical = 'Users'; -$obj->rrd_format = '%.1lf'; - -# backwards compatibility -if ($CONFIG['version'] < 5) { - $obj->data_sources = array('users'); - - $obj->legend['users'] = $obj->legend['value']; - unset($obj->legend['value']); - - $obj->colors['users'] = $obj->colors['value']; - unset($obj->colors['value']); -} - -$obj->rrd_graph(); diff --git a/plugin/varnish.php b/plugin/varnish.php deleted file mode 100644 index f2f597c..0000000 --- a/plugin/varnish.php +++ /dev/null @@ -1,29 +0,0 @@ -rrd_format = '%5.1lf%s'; -$obj->rrd_title = sprintf('%s (%s)', ucfirst($obj->args['pinstance']), $obj->args['category']); -$obj->rrd_vertical = 'hits'; - -$obj->rrd_graph(); diff --git a/plugin/vmem.json b/plugin/vmem.json new file mode 100644 index 0000000..14d214e --- /dev/null +++ b/plugin/vmem.json @@ -0,0 +1,27 @@ +{ + "vmpage_faults": { + "title": "Page faults", + "type": "stacked", + "legend": { + "minflt": { + "name": "Minor", + "color": "0000f0" + }, + "majflt": { + "name": "Major", + "color": "f00000" + } + }, + "legend_format": "%5.1lf%s" + }, + "vmpage_io": { + "title": "Page IO ({{TI}})", + "type": "stacked", + "legend_format": "%5.1lf%s" + }, + "vmpage_number": { + "title": "Pages", + "type": "stacked", + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/vmem.php b/plugin/vmem.php deleted file mode 100644 index f66272b..0000000 --- a/plugin/vmem.php +++ /dev/null @@ -1,58 +0,0 @@ -.rrd - -$obj = new Type_GenericStacked($CONFIG, $_GET); -$obj->rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'vmpage_faults': - $obj->data_sources = array('minflt', 'majflt'); - $obj->colors = array('minflt' => '0000f0', - 'majflt' => 'f00000'); - $obj->legend = array('minflt' => 'Minor', - 'majflt' => 'Major'); - $obj->rrd_title = 'Page faults'; - $obj->rrd_vertical = ''; - break; - case 'vmpage_io': - $obj->data_sources = array('in', 'out'); - $obj->legend = array('memory-in' => 'Memory (in)', - 'memory-out' => 'Memory (out)', - 'swap-in' => 'Swap (in)', - 'swap-out' => 'Swap (out)'); - $obj->colors = array('memory-in' => 'ff0000', - 'memory-out' => '0000ff', - 'swap-in' => 'ff00ff', - 'swap-out' => 'ffff00'); - $obj->rrd_title = 'Page IO'; - $obj->rrd_vertical = ''; - break; - case 'vmpage_number': - $obj->data_sources = array('value'); - $obj->order = array('active_anon', 'active_file', - 'anon_pages', 'bounce', - 'dirty', 'file_pages', - 'free_pages', 'inactive_anon', - 'inactive_file', 'mapped', - 'mlock', 'page_table_pages', - 'slab_reclaimable', 'slab_unreclaimable', - 'unevictable', 'unstable', - #'vmscan_write', - 'writeback', 'writeback_temp'); - $obj->rrd_title = 'Pages'; - $obj->rrd_vertical = ''; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/vserver.json b/plugin/vserver.json new file mode 100644 index 0000000..7366693 --- /dev/null +++ b/plugin/vserver.json @@ -0,0 +1,84 @@ +{ + "load": { + "title": "System load", + "vertical": "System load", + "type": "default", + "legend": { + "shortterm": { + "name": " 1 min", + "color": "00ff00" + }, + "midterm": { + "name": " 5 min", + "color": "0000ff" + }, + "longterm": { + "name": "15 min", + "color": "ff0000" + } + }, + "legend_format": "%.2lf" + }, + "vs_memory": { + "title": "Memory utilization ({{PI}})", + "vertical": "Bytes", + "type": "stacked", + "legend": { + "vm": { + "name": "Virtual memory pages", + "color": "0000ff" + }, + "vml": { + "name": "Pages locked into memory", + "color": "0000ff" + }, + "rss": { + "name": "Resident set size", + "color": "ffb000" + }, + "anon": { + "name": "Anonymous memory pages", + "color": "ff00ff" + } + }, + "legend_format": "%5.1lf%s" + }, + "vs_threads": { + "title": "Threads ({{PI}})", + "type": "stacked", + "legend": { + "running": { + "name": "Running", + "color": "0000ff" + }, + "uninterruptable": { + "name": "Uninterruptible", + "color": "ff00ff" + }, + "onhold": { + "name": "On Hold", + "color": "00e000" + }, + "total": { + "name": "Total", + "color": "Total" + } + }, + "legend_format": "%5.1lf%s" + }, + "if_octets": { + "title": "Interface Traffic ({{PI}})", + "vertical": "{{ND}} per second", + "legend_format": "%5.1lf%s", + "datasize": true + }, + "vs_processes": { + "title": "Processes ({{PI}})", + "legend": { + "value": { + "name": "Processes" + } + }, + "legend_format": "%5.1lf%s" + } +} diff --git a/plugin/vserver.php b/plugin/vserver.php deleted file mode 100644 index 80fad3e..0000000 --- a/plugin/vserver.php +++ /dev/null @@ -1,122 +0,0 @@ -args['type']) { - case 'load': - require_once "plugin/load.php"; - break; - case 'vs_memory': - $obj = new Type_GenericStacked($CONFIG, $_GET); - $obj->order = array('vm', 'vml', 'rss', 'anon'); - # http://oldwiki.linux-vserver.org/Memory+Allocation - $obj->legend = array( - 'vm' => "Virtual memory pages", - 'vml' => "Pages locked into memory", - 'rss' => "Resident set size", - 'anon' => "Anonymous memory pages", - ); - $obj->colors = array( - 'vm' => '00e000', - 'vml' => '0000ff', - 'rss' => 'ffb000', - 'anon' => 'ff00ff', - ); - - $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; - - $obj->rrd_graph(); - break; - case 'vs_threads': - $obj = new Type_GenericStacked($CONFIG, $_GET); - $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); - # http://linux-vserver.org/ProcFS - $obj->legend = array( - 'onhold' => "Number of threads on hold", - 'running' => "Number of running threads", - 'total' => "Total number of threads", - 'uninterruptable' => "Number of uninterruptible threads", - ); - $obj->colors = array( - 'onhold' => '00e000', - 'running' => '0000ff', - 'total' => 'ffb000', - 'uninterruptable' => 'ff00ff', - ); - - $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Numbers'; - $obj->rrd_format = '%5.1lf%s'; - - $obj->rrd_graph(); - break; - case 'if_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->legend = array( - 'inet-rx' => 'IPv4 Receive', - 'inet-tx' => 'IPv4 Transmit', - 'inet6-rx' => 'IPv6 Receive', - 'inet6-tx' => 'IPv6 Transmit', - ); - $obj->colors = array( - 'inet-rx' => '0000ff', - 'inet-tx' => '00b000', - 'inet6-rx' => 'e0e0e0', - 'inet6-tx' => 'ffb000', - 'other-rx' => 'ff00ff', - 'other-tx' => 'a000a0', - 'unix-rx' => '00e000', - 'unix-tx' => '0080ff', - 'unspec-rx' => 'ff0000', - 'unspec-tx' => '000080', - ); - $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize'])); - $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; - $obj->rrd_format = '%5.1lf%s'; - - $obj->rrd_graph(); - break; - case 'vs_processes': - $obj->data_sources = array('value'); - $obj->legend = array( - 'value' => 'Processes', - ); - $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Processes'; - - $obj->rrd_format = '%5.1lf%s'; - - $obj->rrd_graph(); - break; - - default: - die('Not implemented yet.'); - break; -} diff --git a/plugin/wireless.json b/plugin/wireless.json new file mode 100644 index 0000000..1c53489 --- /dev/null +++ b/plugin/wireless.json @@ -0,0 +1,35 @@ +{ + "signal_noise": { + "title": "Noise level ({{PI}})", + "vertical": "dBm", + "legend": { + "value": { + "name": "Noise level", + "color": "0000f0" + } + }, + "legend_format": "%6.1lf" + }, + "signal_power": { + "title": "Signal level ({{PI}})", + "vertical": "dBm", + "legend": { + "value": { + "name": "Signal level", + "color": "0000f0" + } + }, + "legend_format": "%6.1lf" + }, + "signal_quality": { + "title": "Link Quality ({{PI}})", + "vertical": "quality", + "legend": { + "value": { + "name": "Link quality", + "color": "0000f0" + } + }, + "legend_format": "%6.1lf" + } +} diff --git a/plugin/wireless.php b/plugin/wireless.php deleted file mode 100644 index cb3a8a9..0000000 --- a/plugin/wireless.php +++ /dev/null @@ -1,29 +0,0 @@ -data_sources = array('value'); -$obj->legend = array('value' => 'Value'); -$obj->colors = array('value' => '0000f0'); -$obj->rrd_format = '%6.1lf'; - -switch($obj->args['type']) { - case 'signal_noise': - $obj->rrd_title = sprintf('Noise level (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'dBm'; - break; - case 'signal_power': - $obj->rrd_title = sprintf('Signal level (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'dBm'; - break; - case 'signal_quality': - $obj->rrd_title = sprintf('Link Quality (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'quality'; - break; -} - -$obj->rrd_graph(); diff --git a/plugin/zfs_arc.php b/plugin/zfs_arc.php deleted file mode 100644 index 5c25c3a..0000000 --- a/plugin/zfs_arc.php +++ /dev/null @@ -1,97 +0,0 @@ -rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'arc_counts': - $obj->data_sources = array( - 'demand_data', - 'demand_metadata', - 'prefetch_data', - 'prefetch_metadata', - ); - $obj->colors = array( - 'hits-demand_data' => 'ff0000', - 'misses-demand_data' => '880000', - 'hits-demand_metadata' => '00ff00', - 'misses-demand_metadata' => '00aa00', - 'hits-prefetch_data' => '0000ff', - 'misses-prefetch_data' => '00f0f0', - 'hits-prefetch_metadata' => 'ff00ff', - 'misses-prefetch_metadata' => '888800', - ); - $obj->legend = array( - 'hits-demand_data' => 'data hits', - 'misses-demand_data' => 'metadata misses', - 'hits-demand_metadata' => 'metadata hits', - 'misses-demand_metadata' => 'metadata misses', - 'hits-prefetch_data' => 'prefetch data hits', - 'misses-prefetch_data' => 'prefetch data misses', - 'hits-prefetch_metadata' => 'prefetch metadata hits', - 'misses-prefetch_metadata' => 'prefetch metadata misses', - ); - $obj->rrd_title = 'arc counts'; - $obj->rrd_vertical = 'count'; - break; - case 'arc_size': - $obj->data_sources = array('current','target','minlimit','maxlimit'); - $obj->order = array( - 'current', - 'target', - 'minlimit', - 'maxlimit', - ); - $obj->rrd_title = 'Arc size'; - $obj->rrd_vertical = 'bytes'; - break; - case 'arc_l2_bytes': - $obj->data_sources = array( - 'write', - 'read', - ); - $obj->legend = array( - 'write' => 'Write', - 'read' => 'Read', - ); - $obj->colors = array( - 'write' => 'ff0000', - 'read' => '0000ff', - ); - $obj->rrd_title = 'Arc L2 bytes'; - $obj->rrd_vertical = 'bytes'; - break; - case 'arc_l2_size': - $obj->data_sources = array( - 'value', - ); - $obj->legend = array( - 'value' => 'Bytes', - ); - $obj->colors = array( - 'value' => '0000ff', - ); - $obj->rrd_title = 'Arc L2 size'; - $obj->rrd_vertical = 'bytes'; - break; - case 'arc_ratio': - $obj->data_sources = array('value'); - $obj->rrd_title = 'Arc ratio'; - $obj->rrd_vertical = 'ratio'; - break; -} -$obj->rrd_graph(); -- cgit v1.1