aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/libvirt.php
diff options
context:
space:
mode:
authorPim van den Berg2012-09-05 16:07:44 +0200
committerPim van den Berg2012-09-05 16:10:39 +0200
commit074589c36937a468587abe37bc4ce0fbddf80b20 (patch)
tree921ffd1e49dde8bd21f625409f12d70251f3204b /plugin/libvirt.php
parentplugin: add snmp plugin (diff)
downloadapt-panopticon_cgp-074589c36937a468587abe37bc4ce0fbddf80b20.zip
apt-panopticon_cgp-074589c36937a468587abe37bc4ce0fbddf80b20.tar.gz
apt-panopticon_cgp-074589c36937a468587abe37bc4ce0fbddf80b20.tar.bz2
apt-panopticon_cgp-074589c36937a468587abe37bc4ce0fbddf80b20.tar.xz
apply datasize (bytes/bits) only to network related data
As discussed in https://github.com/pommi/CGP/pull/1.
Diffstat (limited to '')
-rw-r--r--plugin/libvirt.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugin/libvirt.php b/plugin/libvirt.php
index 971b5a7..004eb26 100644
--- a/plugin/libvirt.php
+++ b/plugin/libvirt.php
@@ -30,8 +30,7 @@ switch($obj->args['type']) {
30 'write' => '00b000', 30 'write' => '00b000',
31 ); 31 );
32 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['tinstance']); 32 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['tinstance']);
33 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); 33 $obj->rrd_vertical = 'Bytes per second';
34 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
35 $obj->rrd_format = '%5.1lf%s'; 34 $obj->rrd_format = '%5.1lf%s';
36 break; 35 break;
37 case 'disk_ops': 36 case 'disk_ops':
@@ -85,8 +84,8 @@ switch($obj->args['type']) {
85 'tx' => '00b000', 84 'tx' => '00b000',
86 ); 85 );
87 $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); 86 $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']);
88 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); 87 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize']));
89 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; 88 $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1;
90 break; 89 break;
91 case 'if_packets': 90 case 'if_packets':
92 $obj->data_sources = array('rx', 'tx'); 91 $obj->data_sources = array('rx', 'tx');