diff options
author | Conrad Kostecki | 2013-06-01 00:12:38 +0200 |
---|---|---|
committer | Conrad Kostecki | 2013-06-01 00:12:38 +0200 |
commit | ffb1e2bcd691fe3d1d3d66836cc2faa8cbcc1b65 (patch) | |
tree | 70d801ba650fe712ad737fbab8a12f74a36b385a /plugin/thermal.php | |
parent | Merge pull request #8 from mce35/nut (diff) | |
download | apt-panopticon_cgp-ffb1e2bcd691fe3d1d3d66836cc2faa8cbcc1b65.zip apt-panopticon_cgp-ffb1e2bcd691fe3d1d3d66836cc2faa8cbcc1b65.tar.gz apt-panopticon_cgp-ffb1e2bcd691fe3d1d3d66836cc2faa8cbcc1b65.tar.bz2 apt-panopticon_cgp-ffb1e2bcd691fe3d1d3d66836cc2faa8cbcc1b65.tar.xz |
Thermal Plugin added
Diffstat (limited to 'plugin/thermal.php')
-rw-r--r-- | plugin/thermal.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugin/thermal.php b/plugin/thermal.php new file mode 100644 index 0000000..eaef5e8 --- /dev/null +++ b/plugin/thermal.php | |||
@@ -0,0 +1,26 @@ | |||
1 | <?php | ||
2 | |||
3 | # Collectd Thermal plugin | ||
4 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/Default.class.php'; | ||
7 | require_once 'inc/collectd.inc.php'; | ||
8 | |||
9 | ## LAYOUT | ||
10 | # thermal-XXXX/ | ||
11 | # thermal-XXXX/gauge.rrd | ||
12 | |||
13 | $obj = new Type_Default($CONFIG); | ||
14 | $obj->ds_names = array( | ||
15 | 'value' => 'Value', | ||
16 | ); | ||
17 | switch($obj->args['type']) { | ||
18 | case 'gauge': | ||
19 | $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']); | ||
20 | $obj->rrd_vertical = '°C'; | ||
21 | $obj->rrd_format = '%.1lf'; | ||
22 | break; | ||
23 | } | ||
24 | |||
25 | collectd_flush($obj->identifiers); | ||
26 | $obj->rrd_graph(); | ||