aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/nut.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/nut.php')
-rw-r--r--plugin/nut.php77
1 files changed, 0 insertions, 77 deletions
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 @@
1<?php
2
3# Collectd NUT plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/Default.class.php';
7
8## LAYOUT
9# nut-XXXX/
10# nut-XXXX/frequency-XXXX.rrd
11# nut-XXXX/percent-XXXX.rrd
12# nut-XXXX/temerature-XXXX.rrd
13# nut-XXXX/timeleft-XXXX.rrd
14# nut-XXXX/voltage-XXXX.rrd
15
16$obj = new Type_Default($CONFIG, $_GET);
17switch($obj->args['type']) {
18 case 'frequency':
19 if ($CONFIG['version'] < 5) {
20 $obj->data_sources = array('frequency');
21 } else {
22 $obj->data_sources = array('value');
23 }
24 $obj->legend = array('output' => 'Output');
25 $obj->rrd_title = sprintf('Frequency (%s)', $obj->args['pinstance']);
26 $obj->rrd_vertical = 'Hz';
27 $obj->rrd_format = '%5.1lf%s';
28 break;
29 case 'percent':
30 if ($CONFIG['version'] < 5) {
31 $obj->data_sources = array('percent');
32 } else {
33 $obj->data_sources = array('value');
34 }
35 $obj->legend = array('charge' => 'Charge',
36 'load' => 'Load');
37 $obj->rrd_title = sprintf('Charge & load (%s)', $obj->args['pinstance']);
38 $obj->rrd_vertical = '%';
39 $obj->rrd_format = '%5.1lf';
40 break;
41 case 'power':
42 $obj->data_sources = array('value');
43 $obj->legend = array('ups' => 'UPS');
44 $obj->rrd_title = sprintf('Power (%s)', $obj->args['pinstance']);
45 $obj->rrd_vertical = 'VA';
46 $obj->rrd_format = '%5.1lf%s';
47 break;
48 case 'temperature':
49 $obj->data_sources = array('value');
50 $obj->legend = array('battery' => 'Battery');
51 $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']);
52 $obj->rrd_vertical = '°C';
53 $obj->rrd_format = '%5.1lf%s';
54 break;
55 case 'timeleft':
56 if ($CONFIG['version'] < 5) {
57 $obj->data_sources = array('timeleft');
58 } else {
59 $obj->data_sources = array('value');
60 }
61 $obj->legend = array('timeleft' => 'Timeleft');
62 $obj->rrd_title = sprintf('Timeleft (%s)', $obj->args['pinstance']);
63 $obj->rrd_vertical = 'Seconds';
64 $obj->rrd_format = '%5.1lf';
65 break;
66 case 'voltage':
67 $obj->data_sources = array('value');
68 $obj->legend = array('battery' => 'Battery',
69 'input' => 'Input',
70 'output' => 'Output');
71 $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']);
72 $obj->rrd_vertical = 'Volts';
73 $obj->rrd_format = '%5.1lf';
74 break;
75}
76
77$obj->rrd_graph();