diff options
Diffstat (limited to 'plugin/libvirt.php')
-rw-r--r-- | plugin/libvirt.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/plugin/libvirt.php b/plugin/libvirt.php index 0d5071a..829c592 100644 --- a/plugin/libvirt.php +++ b/plugin/libvirt.php | |||
@@ -103,12 +103,12 @@ switch($obj->args['type']) { | |||
103 | require_once 'type/Default.class.php'; | 103 | require_once 'type/Default.class.php'; |
104 | $obj = new Type_Default($CONFIG); | 104 | $obj = new Type_Default($CONFIG); |
105 | 105 | ||
106 | $obj->data_sources = array('ns'); | 106 | $obj->data_sources = array('value'); |
107 | $obj->ds_names = array( | 107 | $obj->ds_names = array( |
108 | 'ns' => 'CPU time', | 108 | 'value' => 'CPU time', |
109 | ); | 109 | ); |
110 | $obj->colors = array( | 110 | $obj->colors = array( |
111 | 'ns' => '0000ff', | 111 | 'value' => '0000ff', |
112 | ); | 112 | ); |
113 | $obj->rrd_title = 'CPU usage'; | 113 | $obj->rrd_title = 'CPU usage'; |
114 | $obj->rrd_vertical = 'CPU time'; | 114 | $obj->rrd_vertical = 'CPU time'; |
@@ -117,12 +117,12 @@ switch($obj->args['type']) { | |||
117 | require_once 'type/Default.class.php'; | 117 | require_once 'type/Default.class.php'; |
118 | $obj = new Type_Default($CONFIG); | 118 | $obj = new Type_Default($CONFIG); |
119 | 119 | ||
120 | $obj->data_sources = array('ns'); | 120 | $obj->data_sources = array('value'); |
121 | $obj->ds_names = array( | 121 | $obj->ds_names = array( |
122 | 'ns' => 'VCPU time', | 122 | 'value' => 'VCPU time', |
123 | ); | 123 | ); |
124 | $obj->colors = array( | 124 | $obj->colors = array( |
125 | 'ns' => '0000ff', | 125 | 'value' => '0000ff', |
126 | ); | 126 | ); |
127 | $obj->rrd_title = 'VCPU usage'; | 127 | $obj->rrd_title = 'VCPU usage'; |
128 | $obj->rrd_vertical = 'VCPU time'; | 128 | $obj->rrd_vertical = 'VCPU time'; |
@@ -133,5 +133,15 @@ $obj->width = $width; | |||
133 | $obj->heigth = $heigth; | 133 | $obj->heigth = $heigth; |
134 | $obj->rrd_format = '%5.1lf%s'; | 134 | $obj->rrd_format = '%5.1lf%s'; |
135 | 135 | ||
136 | if ($CONFIG['version'] < 5 && count($obj->data_sources) == 1) { | ||
137 | $obj->data_sources = array('ns'); | ||
138 | |||
139 | $obj->ds_names['ns'] = $obj->ds_names['value']; | ||
140 | unset($obj->ds_names['value']); | ||
141 | |||
142 | $obj->colors['ns'] = $obj->colors['value']; | ||
143 | unset($obj->colors['value']); | ||
144 | } | ||
145 | |||
136 | collectd_flush($obj->identifiers); | 146 | collectd_flush($obj->identifiers); |
137 | $obj->rrd_graph(); | 147 | $obj->rrd_graph(); |