From edae75c21a8f657dd6cc9ace9e8e844ef337a951 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 3 May 2014 18:15:12 +0200 Subject: rename ds_names and dsname to legend This had nothing to do with an RRD data source. --- plugin/aggregation.php | 2 +- plugin/apache.php | 16 ++++++++-------- plugin/apcups.php | 16 ++++++++-------- plugin/battery.php | 6 +++--- plugin/conntrack.php | 6 +++--- plugin/contextswitch.php | 6 +++--- plugin/cpu.php | 2 +- plugin/df.php | 2 +- plugin/disk.php | 2 +- plugin/dns.php | 2 +- plugin/entropy.php | 6 +++--- plugin/filecount.php | 4 ++-- plugin/hddtemp.php | 2 +- plugin/interface.php | 2 +- plugin/ipmi.php | 2 +- plugin/libvirt.php | 20 ++++++++++---------- plugin/load.php | 2 +- plugin/md.php | 2 +- plugin/memcached.php | 18 +++++++++--------- plugin/memory.php | 2 +- plugin/mysql.php | 14 +++++++------- plugin/netlink.php | 16 ++++++++-------- plugin/nginx.php | 6 +++--- plugin/ntpd.php | 2 +- plugin/nut.php | 12 ++++++------ plugin/openvpn.php | 4 ++-- plugin/ping.php | 2 +- plugin/postgresql.php | 14 +++++++------- plugin/processes.php | 24 ++++++++++++------------ plugin/sensors.php | 2 +- plugin/snmp.php | 2 +- plugin/swap.php | 4 ++-- plugin/tail.php | 6 +++--- plugin/thermal.php | 2 +- plugin/uptime.php | 2 +- plugin/users.php | 6 +++--- plugin/vmem.php | 4 ++-- plugin/vserver.php | 8 ++++---- plugin/wireless.php | 2 +- plugin/zfs_arc.php | 6 +++--- type/Base.class.php | 26 +++++++++++++------------- type/Default.class.php | 4 ++-- type/GenericIO.class.php | 4 ++-- type/GenericStacked.class.php | 4 ++-- type/Uptime.class.php | 4 ++-- 45 files changed, 150 insertions(+), 150 deletions(-) diff --git a/plugin/aggregation.php b/plugin/aggregation.php index 2a74403..0d28fae 100644 --- a/plugin/aggregation.php +++ b/plugin/aggregation.php @@ -15,7 +15,7 @@ switch($pi[0]) { $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->data_sources = array('value'); $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); - $obj->ds_names = array( + $obj->legend = array( 'idle' => 'Idle', 'nice' => 'Nice', 'user' => 'User', diff --git a/plugin/apache.php b/plugin/apache.php index df7fe49..6fa9963 100644 --- a/plugin/apache.php +++ b/plugin/apache.php @@ -17,7 +17,7 @@ $obj = new Type_Default($CONFIG, $_GET); switch ($obj->args['type']) { case 'apache_bytes': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => sprintf('%s/s', ucfirst($CONFIG['network_datasize'])), ); $obj->colors = array( @@ -30,7 +30,7 @@ switch ($obj->args['type']) { break; case 'apache_connections': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Conns/s', ); $obj->colors = array( @@ -42,7 +42,7 @@ switch ($obj->args['type']) { break; case 'apache_idle_workers': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Workers', ); $obj->colors = array( @@ -54,7 +54,7 @@ switch ($obj->args['type']) { break; case 'apache_requests': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Requests/s', ); $obj->colors = array( @@ -93,7 +93,7 @@ switch ($obj->args['type']) { 'read', 'request_start', ); - $obj->ds_names = array( + $obj->legend = array( 'open' => 'Open (empty)', 'waiting' => 'Waiting', 'starting' => 'Starting up', @@ -154,9 +154,9 @@ $obj->rrd_format = '%5.1lf'; # backwards compatibility if ($CONFIG['version'] < 5) { $obj->data_sources = array('count'); - if (count($obj->ds_names) == 1) { - $obj->ds_names['count'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + 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']; diff --git a/plugin/apcups.php b/plugin/apcups.php index 626b8f4..853f0ed 100644 --- a/plugin/apcups.php +++ b/plugin/apcups.php @@ -21,42 +21,42 @@ $obj = new Type_Default($CONFIG, $_GET); switch($obj->args['type']) { case 'charge': $obj->data_sources = array('value'); - $obj->ds_names = array('value' => 'Charge'); + $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->ds_names = array('value' => 'Input Frequency'); + $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->ds_names = array('value' => 'Load'); + $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->ds_names = array('value' => 'Temperature'); + $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->ds_names = array('value' => 'Time Left'); + $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->ds_names = array( + $obj->legend = array( 'battery' => 'Battery Voltage', 'input' => 'Input Voltage', 'output' => 'Output Voltage' @@ -78,8 +78,8 @@ if ($CONFIG['version'] < 5 && $obj->data_sources = array($obj->args['type']); - $obj->ds_names[$obj->args['type']] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend[$obj->args['type']] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors[$obj->args['type']] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/battery.php b/plugin/battery.php index 631776b..fc91955 100644 --- a/plugin/battery.php +++ b/plugin/battery.php @@ -17,17 +17,17 @@ $obj->colors = array( ); switch($obj->args['type']) { case 'charge': - $obj->ds_names = array('value' => '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->ds_names = array('value' => 'Current'); + $obj->legend = array('value' => 'Current'); $obj->rrd_title = sprintf('Current (Battery %s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Ampere'; break; case 'voltage': - $obj->ds_names = array('value' => 'Voltage'); + $obj->legend = array('value' => 'Voltage'); $obj->rrd_title = sprintf('Voltage (Battery %s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Volt'; break; diff --git a/plugin/conntrack.php b/plugin/conntrack.php index 6e2bba0..efd562c 100644 --- a/plugin/conntrack.php +++ b/plugin/conntrack.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Conntrack entries', ); $obj->colors = array( @@ -25,8 +25,8 @@ $obj->rrd_format = '%.1lf'; if ($CONFIG['version'] < 5) { $obj->data_sources = array('entropy'); - $obj->ds_names['entropy'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend['entropy'] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors['entropy'] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php index 71f6d9d..24ba7f2 100644 --- a/plugin/contextswitch.php +++ b/plugin/contextswitch.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Context switches', ); $obj->colors = array( @@ -24,8 +24,8 @@ $obj->rrd_format = '%4.0lf'; if ($CONFIG['version'] < 5) { $obj->data_sources = array('contextswitches'); - $obj->ds_names['contextswitches'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend['contextswitches'] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors['contextswitches'] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/cpu.php b/plugin/cpu.php index 76914a7..2965c9e 100644 --- a/plugin/cpu.php +++ b/plugin/cpu.php @@ -19,7 +19,7 @@ require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->data_sources = array('value'); $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); -$obj->ds_names = array( +$obj->legend = array( 'idle' => 'Idle', 'nice' => 'Nice', 'user' => 'User', diff --git a/plugin/df.php b/plugin/df.php index f6d861b..2c0dfd8 100644 --- a/plugin/df.php +++ b/plugin/df.php @@ -14,7 +14,7 @@ require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->data_sources = array('value'); $obj->order = array('reserved', 'free', 'used'); -$obj->ds_names = array( +$obj->legend = array( 'reserved' => 'Reserved', 'free' => 'Free', 'used' => 'Used', diff --git a/plugin/disk.php b/plugin/disk.php index 27a4acd..28f5eac 100644 --- a/plugin/disk.php +++ b/plugin/disk.php @@ -14,7 +14,7 @@ require_once 'type/GenericIO.class.php'; $obj = new Type_GenericIO($CONFIG, $_GET); $obj->data_sources = array('read', 'write'); -$obj->ds_names = array( +$obj->legend = array( 'read' => 'Read', 'write' => 'Written', ); diff --git a/plugin/dns.php b/plugin/dns.php index cb9bb02..0c44097 100644 --- a/plugin/dns.php +++ b/plugin/dns.php @@ -20,7 +20,7 @@ switch($obj->args['type']) { 'queries', 'responses', ); - $obj->ds_names = array( + $obj->legend = array( 'queries' => 'Queries', 'responses' => 'Responses', ); diff --git a/plugin/entropy.php b/plugin/entropy.php index 0433a4f..0170335 100644 --- a/plugin/entropy.php +++ b/plugin/entropy.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Entropy bits', ); $obj->colors = array( @@ -24,8 +24,8 @@ $obj->rrd_format = '%4.0lf'; if ($CONFIG['version'] < 5) { $obj->data_sources = array('entropy'); - $obj->ds_names['entropy'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend['entropy'] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors['entropy'] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/filecount.php b/plugin/filecount.php index 5fa524d..ead8df8 100644 --- a/plugin/filecount.php +++ b/plugin/filecount.php @@ -17,13 +17,13 @@ $obj->data_sources = array('value'); switch($obj->args['type']) { case 'bytes': - $obj->ds_names = array('value' => 'Size'); + $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->ds_names = array('value' => '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'; diff --git a/plugin/hddtemp.php b/plugin/hddtemp.php index 1d366a9..9e88b6a 100644 --- a/plugin/hddtemp.php +++ b/plugin/hddtemp.php @@ -9,7 +9,7 @@ require_once 'type/Default.class.php'; # hddtemp/temperature-.rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array('temperature' => 'Temperature'); +$obj->legend = array('temperature' => 'Temperature'); $obj->rrd_title = 'HDD Temperature'; $obj->rrd_vertical = '°C'; $obj->rrd_format = '%.1lf'; diff --git a/plugin/interface.php b/plugin/interface.php index cc8c5ce..5728c07 100644 --- a/plugin/interface.php +++ b/plugin/interface.php @@ -18,7 +18,7 @@ require_once 'type/GenericIO.class.php'; $obj = new Type_GenericIO($CONFIG, $_GET); $obj->data_sources = array('rx', 'tx'); -$obj->ds_names = array( +$obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); diff --git a/plugin/ipmi.php b/plugin/ipmi.php index 8e6b7bf..5593daf 100644 --- a/plugin/ipmi.php +++ b/plugin/ipmi.php @@ -19,7 +19,7 @@ require_once 'type/Default.class.php'; # voltage-VBAT system_board (7.1).rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Value', ); switch($obj->args['type']) { diff --git a/plugin/libvirt.php b/plugin/libvirt.php index 0d7fff0..bcaeeb9 100644 --- a/plugin/libvirt.php +++ b/plugin/libvirt.php @@ -20,7 +20,7 @@ $obj = new Type_GenericIO($CONFIG, $_GET); switch($obj->args['type']) { case 'disk_octets': $obj->data_sources = array('read', 'write'); - $obj->ds_names = array( + $obj->legend = array( 'read' => 'Read', 'write' => 'Written', ); @@ -34,7 +34,7 @@ switch($obj->args['type']) { break; case 'disk_ops': $obj->data_sources = array('read', 'write'); - $obj->ds_names = array( + $obj->legend = array( 'read' => 'Read', 'write' => 'Written', ); @@ -48,7 +48,7 @@ switch($obj->args['type']) { break; case 'if_dropped': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -61,7 +61,7 @@ switch($obj->args['type']) { break; case 'if_errors': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -74,7 +74,7 @@ switch($obj->args['type']) { break; case 'if_octets': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -88,7 +88,7 @@ switch($obj->args['type']) { break; case 'if_packets': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -104,7 +104,7 @@ switch($obj->args['type']) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'CPU time', ); $obj->colors = array( @@ -118,7 +118,7 @@ switch($obj->args['type']) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'VCPU time', ); $obj->colors = array( @@ -134,8 +134,8 @@ $obj->rrd_format = '%5.1lf%s'; if ($CONFIG['version'] < 5 && count($obj->data_sources) == 1) { $obj->data_sources = array('ns'); - $obj->ds_names['ns'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend['ns'] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors['ns'] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/load.php b/plugin/load.php index a6e3355..78520c5 100644 --- a/plugin/load.php +++ b/plugin/load.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('shortterm', 'midterm', 'longterm'); -$obj->ds_names = array( +$obj->legend = array( 'shortterm' => ' 1 min', 'midterm' => ' 5 min', 'longterm' => '15 min', diff --git a/plugin/md.php b/plugin/md.php index 03f529a..9d09efe 100644 --- a/plugin/md.php +++ b/plugin/md.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; # md-XXXX/md_disks-XXXX.rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Value', ); $obj->rrd_title = sprintf('Disks (md-%s)', $obj->args['pinstance']); diff --git a/plugin/memcached.php b/plugin/memcached.php index 09715ae..62eebfd 100644 --- a/plugin/memcached.php +++ b/plugin/memcached.php @@ -27,7 +27,7 @@ switch(GET('t')) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('used', 'free'); $obj->order = array('used', 'free'); - $obj->ds_names = array( + $obj->legend = array( 'used' => 'Used', 'free' => 'Free', ); @@ -44,7 +44,7 @@ switch(GET('t')) { require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('flush', 'get', 'set'); - $obj->ds_names = array( + $obj->legend = array( 'flush' => 'Flush', 'get' => 'Get', 'set' => 'Set', @@ -63,7 +63,7 @@ switch(GET('t')) { require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Connections', ); $obj->colors = array( @@ -78,7 +78,7 @@ switch(GET('t')) { require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value ' => 'Items', ); $obj->colors = array( @@ -94,7 +94,7 @@ switch(GET('t')) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('rx', 'tx'); $obj->order = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -111,7 +111,7 @@ switch(GET('t')) { require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('evictions', 'hits', 'misses'); - $obj->ds_names = array( + $obj->legend = array( 'evictions' => 'Evictions', 'hits' => 'Hits', 'misses' => 'Misses', @@ -130,7 +130,7 @@ switch(GET('t')) { require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('percent'); - $obj->ds_names = array( + $obj->legend = array( 'percent ' => 'Percentage', ); $obj->colors = array( @@ -145,7 +145,7 @@ switch(GET('t')) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('threads'); $obj->order = array('threads'); - $obj->ds_names = array( + $obj->legend = array( 'threads' => 'Threads', ); $obj->colors = array( @@ -161,7 +161,7 @@ switch(GET('t')) { $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('user', 'syst'); $obj->order = array('user', 'syst'); - $obj->ds_names = array( + $obj->legend = array( 'user' => 'User', 'syst' => 'System', ); diff --git a/plugin/memory.php b/plugin/memory.php index 9fd2e30..0a1fe68 100644 --- a/plugin/memory.php +++ b/plugin/memory.php @@ -14,7 +14,7 @@ require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('free', 'inactive', 'buffered', 'cached', 'cache', 'locked', 'used', 'active', 'wired'); -$obj->ds_names = array( +$obj->legend = array( 'free' => 'Free', 'inactive' => 'Inactive', 'cached' => 'Cached', diff --git a/plugin/mysql.php b/plugin/mysql.php index aad0131..880b8c0 100644 --- a/plugin/mysql.php +++ b/plugin/mysql.php @@ -11,7 +11,7 @@ $obj->rrd_format = '%5.1lf%s'; switch($obj->args['type']) { case 'cache_result': - $obj->ds_names = array( + $obj->legend = array( 'qcache-not_cached' => 'Not Cached', 'qcache-inserts' => 'Inserts', 'qcache-hits' => 'Hits', @@ -27,7 +27,7 @@ switch($obj->args['type']) $obj->rrd_vertical = 'Queries/s'; break; case 'cache_size': - $obj->ds_names = array( + $obj->legend = array( 'qcache' => 'Queries', ); $obj->rrd_title = sprintf('MySQL query cache size (%s)', $obj->args['pinstance']); @@ -65,7 +65,7 @@ switch($obj->args['type']) break; case 'mysql_octets': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -77,7 +77,7 @@ switch($obj->args['type']) $obj->rrd_vertical = 'Bits per second'; break; case 'threads': - $obj->ds_names = array( + $obj->legend = array( 'cached' => 'Cached', 'connected' => 'Connected', 'running' => 'Running', @@ -91,7 +91,7 @@ switch($obj->args['type']) $obj->rrd_vertical = 'Threads'; break; case 'total_threads': - $obj->ds_names = array( + $obj->legend = array( 'created' => 'Created', ); $obj->rrd_title = sprintf('MySQL created threads (%s)', $obj->args['pinstance']); @@ -100,7 +100,7 @@ switch($obj->args['type']) # 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->ds_names = array( + $obj->legend = array( 'not_cached' => 'Not Cached', 'inserts' => 'Inserts', 'hits' => 'Hits', @@ -120,7 +120,7 @@ switch($obj->args['type']) # mysql_threads is removed since commit collectd-4.10.0-105-g6c48fca case 'mysql_threads': $obj->data_sources = array('cached', 'connected', 'running', 'created'); - $obj->ds_names = array( + $obj->legend = array( 'cached' => 'Cached', 'connected' => 'Connected', 'running' => 'Running', diff --git a/plugin/netlink.php b/plugin/netlink.php index 28a25f1..9ddaee8 100644 --- a/plugin/netlink.php +++ b/plugin/netlink.php @@ -12,14 +12,14 @@ $obj->rrd_format = '%5.1lf%s'; switch($obj->args['type']) { case 'if_collisions': $obj->data_sources = array('value'); - $obj->ds_names = array('value' => 'Collisions'); + $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->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -32,7 +32,7 @@ switch($obj->args['type']) { break; case 'if_errors': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -45,14 +45,14 @@ switch($obj->args['type']) { break; case 'if_multicast': $obj->data_sources = array('value'); - $obj->ds_names = array('value' => 'Packets'); + $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->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -66,7 +66,7 @@ switch($obj->args['type']) { break; case 'if_packets': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -79,7 +79,7 @@ switch($obj->args['type']) { break; case 'if_rx_errors': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'crc' => 'CRC', 'fifo' => 'FiFo', 'frame' => 'Frame', @@ -100,7 +100,7 @@ switch($obj->args['type']) { break; case 'if_tx_errors': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'aborted' => 'Aborted', 'carrier' => 'Carrier', 'fifo' => 'FiFo', diff --git a/plugin/nginx.php b/plugin/nginx.php index 7d70190..cbb0fa4 100644 --- a/plugin/nginx.php +++ b/plugin/nginx.php @@ -21,7 +21,7 @@ switch($obj->args['type']) { case 'connections': $obj->order = array('accepted', 'handled'); - $obj->ds_names = array( + $obj->legend = array( 'accepted' => 'Accepted', 'handled' => 'Handled', ); @@ -34,7 +34,7 @@ switch($obj->args['type']) break; case 'nginx_connections': $obj->order = array('active', 'reading', 'waiting', 'writing'); - $obj->ds_names = array( + $obj->legend = array( 'active' => 'Active', 'reading' => 'Reading', 'waiting' => 'Waiting', @@ -50,7 +50,7 @@ switch($obj->args['type']) $obj->rrd_vertical = 'Connections/s'; break; case 'nginx_requests': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Requests', ); $obj->colors = array( diff --git a/plugin/ntpd.php b/plugin/ntpd.php index 22f9580..ceea1db 100644 --- a/plugin/ntpd.php +++ b/plugin/ntpd.php @@ -13,7 +13,7 @@ require_once 'type/Default.class.php'; # ntpd/time_offset-.rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array('ping' => 'Ping time', +$obj->legend = array('ping' => 'Ping time', 'ping_stddev' => 'Ping stddev', 'ping_droprate' => 'Ping droprate'); $obj->rrd_format = '%5.1lf%s'; diff --git a/plugin/nut.php b/plugin/nut.php index f8d7150..eb2ceb2 100644 --- a/plugin/nut.php +++ b/plugin/nut.php @@ -21,7 +21,7 @@ switch($obj->args['type']) { } else { $obj->data_sources = array('value'); } - $obj->ds_names = array('output' => 'Output'); + $obj->legend = array('output' => 'Output'); $obj->rrd_title = sprintf('Frequency (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Hz'; $obj->rrd_format = '%5.1lf%s'; @@ -32,7 +32,7 @@ switch($obj->args['type']) { } else { $obj->data_sources = array('value'); } - $obj->ds_names = array('charge' => 'Charge', + $obj->legend = array('charge' => 'Charge', 'load' => 'Load'); $obj->rrd_title = sprintf('Charge & load (%s)', $obj->args['pinstance']); $obj->rrd_vertical = '%'; @@ -40,14 +40,14 @@ switch($obj->args['type']) { break; case 'power': $obj->data_sources = array('value'); - $obj->ds_names = array('ups' => 'UPS'); + $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->ds_names = array('battery' => 'Battery'); + $obj->legend = array('battery' => 'Battery'); $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); $obj->rrd_vertical = '°C'; $obj->rrd_format = '%5.1lf%s'; @@ -58,14 +58,14 @@ switch($obj->args['type']) { } else { $obj->data_sources = array('value'); } - $obj->ds_names = array('timeleft' => 'Timeleft'); + $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->ds_names = array('battery' => 'Battery', + $obj->legend = array('battery' => 'Battery', 'input' => 'Input', 'output' => 'Output'); $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']); diff --git a/plugin/openvpn.php b/plugin/openvpn.php index 1ff6dd1..6eba3d5 100644 --- a/plugin/openvpn.php +++ b/plugin/openvpn.php @@ -14,7 +14,7 @@ switch(GET('t')) { require_once 'type/GenericIO.class.php'; $obj = new Type_GenericIO($CONFIG, $_GET); $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); @@ -30,7 +30,7 @@ switch(GET('t')) { case 'users': require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Users', ); $obj->rrd_title = sprintf('Users (%s)', $obj->args['pinstance']); diff --git a/plugin/ping.php b/plugin/ping.php index 845a6d9..ca2920c 100644 --- a/plugin/ping.php +++ b/plugin/ping.php @@ -13,7 +13,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array('ping' => 'Ping time', +$obj->legend = array('ping' => 'Ping time', 'ping_stddev' => 'Ping stddev', 'ping_droprate' => 'Ping droprate'); $obj->rrd_format = '%5.1lf'; diff --git a/plugin/postgresql.php b/plugin/postgresql.php index 4c2a62f..4cfae41 100644 --- a/plugin/postgresql.php +++ b/plugin/postgresql.php @@ -25,7 +25,7 @@ $obj->rrd_format = '%5.1lf%s'; switch($obj->args['type']) { case 'pg_blks': - $obj->ds_names = array( + $obj->legend = array( 'heap_hit' => 'Heap hit', 'heap_read' => 'Heap read', 'idx_hit' => 'Index hit', @@ -40,7 +40,7 @@ switch($obj->args['type']) { $obj->rrd_vertical = 'Blocks'; break; case 'pg_db_size': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Size', ); $obj->colors = array( @@ -57,7 +57,7 @@ switch($obj->args['type']) { 'hot_upd', 'del', ); - $obj->ds_names = array( + $obj->legend = array( 'ins' => 'Insert', 'upd' => 'Update', 'hot_upd' => 'Hot Update', @@ -75,7 +75,7 @@ switch($obj->args['type']) { break; case 'pg_n_tup_g': $obj->order = array('live', 'dead'); - $obj->ds_names = array( + $obj->legend = array( 'live' => 'Live', 'dead' => 'Dead', ); @@ -88,7 +88,7 @@ switch($obj->args['type']) { $obj->rrd_vertical = 'Rows'; break; case 'pg_numbackends': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Backends', ); $obj->colors = array( @@ -99,7 +99,7 @@ switch($obj->args['type']) { $obj->rrd_vertical = 'Number'; break; case 'pg_scan': - $obj->ds_names = array( + $obj->legend = array( 'seq' => 'Sequential', 'seq_tup_read' => 'Sequential rows', 'idx' => 'Index', @@ -110,7 +110,7 @@ switch($obj->args['type']) { $obj->rrd_vertical = 'Scans / Rows'; break; case 'pg_xact': - $obj->ds_names = array( + $obj->legend = array( 'commit' => 'Commit', 'rollback' => 'Rollback', ); diff --git a/plugin/processes.php b/plugin/processes.php index a35800b..27819cc 100644 --- a/plugin/processes.php +++ b/plugin/processes.php @@ -20,7 +20,7 @@ $obj->rrd_format = '%5.1lf%s'; switch($obj->args['type']) { case 'ps_state': - $obj->ds_names = array( + $obj->legend = array( 'paging' => 'Paging', 'blocked' => 'Blocked', 'zombies' => 'Zombies', @@ -42,7 +42,7 @@ switch($obj->args['type']) break; case 'fork_rate': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Forks', ); $obj->colors = array( @@ -53,7 +53,7 @@ switch($obj->args['type']) break; case 'ps_code': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'TRS', ); $obj->colors = array( @@ -65,7 +65,7 @@ switch($obj->args['type']) case 'ps_count': $obj->data_sources = array('processes', 'threads'); - $obj->ds_names = array( + $obj->legend = array( 'processes' => 'Processes', 'threads' => 'Threads', ); @@ -79,7 +79,7 @@ switch($obj->args['type']) case 'ps_cputime': $obj->data_sources = array('user', 'syst'); - $obj->ds_names = array( + $obj->legend = array( 'user' => 'User', 'syst' => 'System', ); @@ -93,7 +93,7 @@ switch($obj->args['type']) case 'ps_disk_octets': $obj->data_sources = array('read', 'write'); - $obj->ds_names = array( + $obj->legend = array( 'read' => 'Read', 'write' => 'Write', ); @@ -107,7 +107,7 @@ switch($obj->args['type']) case 'ps_disk_ops': $obj->data_sources = array('read', 'write'); - $obj->ds_names = array( + $obj->legend = array( 'read' => 'Read', 'write' => 'Write', ); @@ -120,7 +120,7 @@ switch($obj->args['type']) break; case 'ps_data': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'DRS', ); $obj->colors = array( @@ -132,7 +132,7 @@ switch($obj->args['type']) case 'ps_pagefaults': $obj->data_sources = array('minflt', 'majflt'); - $obj->ds_names = array( + $obj->legend = array( 'minflt' => 'Minor', 'majflt' => 'Major', ); @@ -145,7 +145,7 @@ switch($obj->args['type']) break; case 'ps_rss': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'RSS', ); $obj->colors = array( @@ -156,7 +156,7 @@ switch($obj->args['type']) break; case 'ps_stacksize': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Stacksize', ); $obj->colors = array( @@ -167,7 +167,7 @@ switch($obj->args['type']) break; case 'ps_vm': - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Memory', ); $obj->colors = array( diff --git a/plugin/sensors.php b/plugin/sensors.php index 0ac2ccd..e0c0d9c 100644 --- a/plugin/sensors.php +++ b/plugin/sensors.php @@ -12,7 +12,7 @@ require_once 'type/Default.class.php'; # sensors-XXXX/voltage-XXXX.rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Value', ); switch($obj->args['type']) { diff --git a/plugin/snmp.php b/plugin/snmp.php index 4d871a8..4fbebbb 100644 --- a/plugin/snmp.php +++ b/plugin/snmp.php @@ -10,7 +10,7 @@ switch(GET('t')) { require_once 'type/GenericIO.class.php'; $obj = new Type_GenericIO($CONFIG, $_GET); $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'rx' => 'Receive', 'tx' => 'Transmit', ); diff --git a/plugin/swap.php b/plugin/swap.php index 5b02130..140772c 100644 --- a/plugin/swap.php +++ b/plugin/swap.php @@ -15,7 +15,7 @@ switch(GET('t')) { require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('free', 'cached', 'used'); - $obj->ds_names = array( + $obj->legend = array( 'free' => 'Free', 'cached' => 'Cached', 'used' => 'Used', @@ -32,7 +32,7 @@ switch(GET('t')) { require_once 'type/GenericIO.class.php'; $obj = new Type_GenericIO($CONFIG, $_GET); $obj->order = array('out', 'in'); - $obj->ds_names = array( + $obj->legend = array( 'out' => 'Out', 'in' => 'In', ); diff --git a/plugin/tail.php b/plugin/tail.php index 91400c7..5698558 100644 --- a/plugin/tail.php +++ b/plugin/tail.php @@ -15,9 +15,9 @@ $obj->rrd_format = '%5.1lf%s'; if ($CONFIG['version'] < 5) { if (strcmp($obj->args['type'], 'gauge') != 0) { $obj->data_sources = array('count'); - if (count($obj->ds_names) == 1) { - $obj->ds_names['count'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + 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']; diff --git a/plugin/thermal.php b/plugin/thermal.php index fb39ecb..9f25787 100644 --- a/plugin/thermal.php +++ b/plugin/thermal.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; # thermal-XXXX/gauge.rrd $obj = new Type_Default($CONFIG, $_GET); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Temperature', ); switch($obj->args['type']) { diff --git a/plugin/uptime.php b/plugin/uptime.php index 20c44d3..ca45d76 100644 --- a/plugin/uptime.php +++ b/plugin/uptime.php @@ -10,7 +10,7 @@ require_once 'type/Uptime.class.php'; $obj = new Type_Uptime($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Current', ); $obj->colors = array( diff --git a/plugin/users.php b/plugin/users.php index 6b3bc4e..f49de38 100644 --- a/plugin/users.php +++ b/plugin/users.php @@ -10,7 +10,7 @@ require_once 'type/Default.class.php'; $obj = new Type_Default($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array( +$obj->legend = array( 'value' => 'Users', ); $obj->colors = array( @@ -24,8 +24,8 @@ $obj->rrd_format = '%.1lf'; if ($CONFIG['version'] < 5) { $obj->data_sources = array('users'); - $obj->ds_names['users'] = $obj->ds_names['value']; - unset($obj->ds_names['value']); + $obj->legend['users'] = $obj->legend['value']; + unset($obj->legend['value']); $obj->colors['users'] = $obj->colors['value']; unset($obj->colors['value']); diff --git a/plugin/vmem.php b/plugin/vmem.php index 8fb81ce..f66272b 100644 --- a/plugin/vmem.php +++ b/plugin/vmem.php @@ -20,14 +20,14 @@ switch($obj->args['type']) { $obj->data_sources = array('minflt', 'majflt'); $obj->colors = array('minflt' => '0000f0', 'majflt' => 'f00000'); - $obj->ds_names = array('minflt' => 'Minor', + $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->ds_names = array('memory-in' => 'Memory (in)', + $obj->legend = array('memory-in' => 'Memory (in)', 'memory-out' => 'Memory (out)', 'swap-in' => 'Swap (in)', 'swap-out' => 'Swap (out)'); diff --git a/plugin/vserver.php b/plugin/vserver.php index 27e739f..80fad3e 100644 --- a/plugin/vserver.php +++ b/plugin/vserver.php @@ -34,7 +34,7 @@ switch($obj->args['type']) { $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('vm', 'vml', 'rss', 'anon'); # http://oldwiki.linux-vserver.org/Memory+Allocation - $obj->ds_names = array( + $obj->legend = array( 'vm' => "Virtual memory pages", 'vml' => "Pages locked into memory", 'rss' => "Resident set size", @@ -57,7 +57,7 @@ switch($obj->args['type']) { $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); # http://linux-vserver.org/ProcFS - $obj->ds_names = array( + $obj->legend = array( 'onhold' => "Number of threads on hold", 'running' => "Number of running threads", 'total' => "Total number of threads", @@ -78,7 +78,7 @@ switch($obj->args['type']) { break; case 'if_octets': $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( + $obj->legend = array( 'inet-rx' => 'IPv4 Receive', 'inet-tx' => 'IPv4 Transmit', 'inet6-rx' => 'IPv6 Receive', @@ -105,7 +105,7 @@ switch($obj->args['type']) { break; case 'vs_processes': $obj->data_sources = array('value'); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Processes', ); $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); diff --git a/plugin/wireless.php b/plugin/wireless.php index 991a0f3..cb3a8a9 100644 --- a/plugin/wireless.php +++ b/plugin/wireless.php @@ -7,7 +7,7 @@ require_once 'type/GenericStacked.class.php'; $obj = new Type_GenericStacked($CONFIG, $_GET); $obj->data_sources = array('value'); -$obj->ds_names = array('value' => 'Value'); +$obj->legend = array('value' => 'Value'); $obj->colors = array('value' => '0000f0'); $obj->rrd_format = '%6.1lf'; diff --git a/plugin/zfs_arc.php b/plugin/zfs_arc.php index 5fc4407..5c25c3a 100644 --- a/plugin/zfs_arc.php +++ b/plugin/zfs_arc.php @@ -35,7 +35,7 @@ switch($obj->args['type']) { 'hits-prefetch_metadata' => 'ff00ff', 'misses-prefetch_metadata' => '888800', ); - $obj->ds_names = array( + $obj->legend = array( 'hits-demand_data' => 'data hits', 'misses-demand_data' => 'metadata misses', 'hits-demand_metadata' => 'metadata hits', @@ -64,7 +64,7 @@ switch($obj->args['type']) { 'write', 'read', ); - $obj->ds_names = array( + $obj->legend = array( 'write' => 'Write', 'read' => 'Read', ); @@ -79,7 +79,7 @@ switch($obj->args['type']) { $obj->data_sources = array( 'value', ); - $obj->ds_names = array( + $obj->legend = array( 'value' => 'Bytes', ); $obj->colors = array( diff --git a/type/Base.class.php b/type/Base.class.php index e1aae19..7c06e5d 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -11,7 +11,7 @@ class Type_Base { var $seconds; var $data_sources = array('value'); var $order; - var $ds_names; + var $legend; var $colors; var $rrd_title; var $rrd_vertical; @@ -281,26 +281,26 @@ class Type_Base { $sources = $this->data_sources; } } - $this->parse_ds_names($sources); + $this->parse_legend($sources); return $sources; } - function parse_ds_names($sources) { - # fill ds_names if not defined by plugin - if (!is_array($this->ds_names)) - $this->ds_names = array_combine($sources, $sources); + function parse_legend($sources) { + # fill legend if not defined by plugin + if (!is_array($this->legend)) + $this->legend = array_combine($sources, $sources); - # detect length of longest ds_name + # detect length of longest legend $max = 0; - foreach ($this->ds_names as $ds_name) { - if(strlen((string)$ds_name) > $max) - $max = strlen((string)$ds_name); + foreach ($this->legend as $legend) { + if(strlen((string)$legend) > $max) + $max = strlen((string)$legend); } - # make all ds_names equal in lenght + # make all legend equal in lenght $format = sprintf("%%-%ds", $max); - foreach ($this->ds_names as $index => $value) { - $this->ds_names[$index] = sprintf($format, $value); + foreach ($this->legend as $index => $value) { + $this->legend[$index] = sprintf($format, $value); } } diff --git a/type/Default.class.php b/type/Default.class.php index 52827c2..9f3b97a 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -47,9 +47,9 @@ class Type_Default extends Type_Base { $c = 0; foreach ($sources as $source) { - $dsname = empty($this->ds_names[$source]) ? $source : $this->ds_names[$source]; + $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; $color = is_array($this->colors) ? (isset($this->colors[$source])?$this->colors[$source]:$this->colors[$c++]): $this->colors; - $rrdgraph[] = sprintf('"LINE1:avg_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($dsname)); + $rrdgraph[] = sprintf('"LINE1:avg_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($legend)); $rrdgraph[] = sprintf('"GPRINT:min_%s:MIN:%s Min,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:avg_%s:AVERAGE:%s Avg,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:max_%s:MAX:%s Max,"', crc32hex($source), $this->rrd_format); diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php index df3a057..fac7034 100644 --- a/type/GenericIO.class.php +++ b/type/GenericIO.class.php @@ -56,8 +56,8 @@ class Type_GenericIO extends Type_Base { $i = 0; foreach($sources as $source) { - $dsname = empty($this->ds_names[$source]) ? $source : $this->ds_names[$source]; - $rrdgraph[] = sprintf('"LINE1:avg_%s%s#%s:%s"', crc32hex($source), $i == 1 ? '_neg' : '', $this->colors[$source], $this->rrd_escape($dsname)); + $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; + $rrdgraph[] = sprintf('"LINE1:avg_%s%s#%s:%s"', crc32hex($source), $i == 1 ? '_neg' : '', $this->colors[$source], $this->rrd_escape($legend)); $rrdgraph[] = sprintf('"GPRINT:min_%s:MIN:%s Min,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:avg_%s:AVERAGE:%s Avg,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:max_%s:MAX:%s Max,"', crc32hex($source), $this->rrd_format); diff --git a/type/GenericStacked.class.php b/type/GenericStacked.class.php index 4a08c91..a74ff18 100644 --- a/type/GenericStacked.class.php +++ b/type/GenericStacked.class.php @@ -49,9 +49,9 @@ class Type_GenericStacked extends Type_Base { $c = 0; foreach ($sources as $source) { - $dsname = empty($this->ds_names[$source]) ? $source : $this->ds_names[$source]; + $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; $color = is_array($this->colors) ? (isset($this->colors[$source])?$this->colors[$source]:$this->colors[$c++]) : $this->colors; - $rrdgraph[] = sprintf('"LINE1:area_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($dsname)); + $rrdgraph[] = sprintf('"LINE1:area_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($legend)); $rrdgraph[] = sprintf('"GPRINT:min_%s:MIN:%s Min,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:avg_%s:AVERAGE:%s Avg,"', crc32hex($source), $this->rrd_format); $rrdgraph[] = sprintf('"GPRINT:max_%s:MAX:%s Max,"', crc32hex($source), $this->rrd_format); diff --git a/type/Uptime.class.php b/type/Uptime.class.php index 3f8a01e..e57df0b 100644 --- a/type/Uptime.class.php +++ b/type/Uptime.class.php @@ -41,11 +41,11 @@ class Type_Uptime extends Type_Base { $c = 0; foreach ($sources as $source) { - $dsname = empty($this->ds_names[$source]) ? $source : $this->ds_names[$source]; + $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; $color = is_array($this->colors) ? (isset($this->colors[$source])?$this->colors[$source]:$this->colors[$c++]) : $this->colors; //current value - $rrdgraph[] = sprintf('"LINE1:area_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($dsname)); + $rrdgraph[] = sprintf('"LINE1:area_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($legend)); $rrdgraph[] = sprintf('"GPRINT:c_avg_%s:LAST:%s days\\l"', crc32hex($source), $this->rrd_format); //max value -- cgit v1.1