aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/apcups.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/apcups.php')
-rw-r--r--plugin/apcups.php89
1 files changed, 0 insertions, 89 deletions
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 @@
1<?php
2
3# Collectd APC UPS plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/Default.class.php';
7
8## LAYOUT
9# apcups/
10# apcups/charge.rrd
11# apcups/frequency-input.rrd
12# apcups/percent-load.rrd
13# apcups/temperature.rrd
14# apcups/timeleft.rrd
15# apcups/voltage-battery.rrd
16# apcups/voltage-input.rrd
17# apcups/voltage-output.rrd
18
19$obj = new Type_Default($CONFIG, $_GET);
20
21switch($obj->args['type']) {
22 case 'charge':
23 $obj->data_sources = array('value');
24 $obj->legend = array('value' => 'Charge');
25 $obj->colors = array('value' => '0000f0');
26 $obj->rrd_title = sprintf('UPS Charge');
27 $obj->rrd_vertical = 'Ampere hours';
28 break;
29 case 'frequency':
30 $obj->data_sources = array('value');
31 $obj->legend = array('value' => 'Input Frequency');
32 $obj->colors = array('value' => '0000f0');
33 $obj->rrd_title = sprintf('UPS Input Frequency');
34 $obj->rrd_vertical = 'Hertz';
35 break;
36 case 'percent':
37 $obj->data_sources = array('value');
38 $obj->legend = array('value' => 'Load');
39 $obj->colors = array('value' => '0000f0');
40 $obj->rrd_title = sprintf('UPS Load');
41 $obj->rrd_vertical = 'Percent';
42 break;
43 case 'temperature':
44 $obj->data_sources = array('value');
45 $obj->legend = array('value' => 'Temperature');
46 $obj->colors = array('value' => '0000f0');
47 $obj->rrd_title = sprintf('UPS Temperature');
48 $obj->rrd_vertical = 'Celsius';
49 break;
50 case 'timeleft':
51 $obj->data_sources = array('value');
52 $obj->legend = array('value' => 'Time Left');
53 $obj->colors = array('value' => '0000f0');
54 $obj->rrd_title = sprintf('UPS Time Left');
55 $obj->rrd_vertical = 'Seconds';
56 break;
57 case 'voltage':
58 $obj->order = array('battery', 'input', 'output');
59 $obj->legend = array(
60 'battery' => 'Battery Voltage',
61 'input' => 'Input Voltage',
62 'output' => 'Output Voltage'
63 );
64 $obj->colors = array(
65 'battery' => '0000f0',
66 'input' => '00f000',
67 'output' => 'f00000'
68 );
69 $obj->rrd_title = sprintf('UPS Voltage');
70 $obj->rrd_vertical = 'Volt';
71 break;
72}
73$obj->rrd_format = '%5.1lf%s';
74
75# backwards compatibility
76if ($CONFIG['version'] < 5 &&
77 in_array($obj->args['type'], array('frequency', 'percent', 'timeleft'))) {
78
79 $obj->data_sources = array($obj->args['type']);
80
81 $obj->legend[$obj->args['type']] = $obj->legend['value'];
82 unset($obj->legend['value']);
83
84 $obj->colors[$obj->args['type']] = $obj->colors['value'];
85 unset($obj->colors['value']);
86}
87
88$obj->rrd_graph();
89