aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
authorThomas Harold2013-06-29 12:50:10 -0400
committerPim van den Berg2014-03-23 11:15:40 +0100
commit712eabbe86ccba24a84ce8b23f49dd4ff8bebed9 (patch)
tree8557afc47253795cd74df5ee7d4828a019bbbfaf /plugin
parentinc/functions.inc.php: rm trailing slash in base and resolve symlink (diff)
downloadapt-panopticon_cgp-712eabbe86ccba24a84ce8b23f49dd4ff8bebed9.zip
apt-panopticon_cgp-712eabbe86ccba24a84ce8b23f49dd4ff8bebed9.tar.gz
apt-panopticon_cgp-712eabbe86ccba24a84ce8b23f49dd4ff8bebed9.tar.bz2
apt-panopticon_cgp-712eabbe86ccba24a84ce8b23f49dd4ff8bebed9.tar.xz
plugin: add ipmi plugin
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ipmi.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/plugin/ipmi.php b/plugin/ipmi.php
new file mode 100644
index 0000000..e06e4ad
--- /dev/null
+++ b/plugin/ipmi.php
@@ -0,0 +1,45 @@
1<?php
2
3# Collectd Sensors plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/Default.class.php';
7require_once 'inc/collectd.inc.php';
8
9## LAYOUT (similar to sensors plugin)
10#
11# collectd, by default, creates the ipmi RRDs in the following pattern:
12# /(basedir)/(hostname)/ipmi/(type)-(instance).rrd
13#
14# Instances for IPMI usually have spaces in the filename, such as:
15#
16# temperature-System Temp system_board (7.1).rrd
17# voltage-+1.1 V system_board (7.1).rrd
18# voltage--12 V system_board (7.1).rrd
19# voltage-+12 V system_board (7.1).rrd
20# voltage-VBAT system_board (7.1).rrd
21
22$obj = new Type_Default($CONFIG);
23$obj->ds_names = array(
24 'value' => 'Value',
25);
26switch($obj->args['type']) {
27 case 'fanspeed':
28 $obj->rrd_title = sprintf('Fanspeed (%s)', $obj->args['pinstance']);
29 $obj->rrd_vertical = 'RPM';
30 $obj->rrd_format = '%5.1lf';
31 break;
32 case 'temperature':
33 $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']);
34 $obj->rrd_vertical = 'Celsius';
35 $obj->rrd_format = '%5.1lf%s';
36 break;
37 case 'voltage':
38 $obj->rrd_title = sprintf('Voltage (%s)', $obj->args['pinstance']);
39 $obj->rrd_vertical = 'Volt';
40 $obj->rrd_format = '%5.1lf';
41 break;
42}
43
44collectd_flush($obj->identifiers);
45$obj->rrd_graph();