diff options
| author | Pim van den Berg | 2013-06-01 02:30:51 -0700 |
|---|---|---|
| committer | Pim van den Berg | 2013-06-01 02:30:51 -0700 |
| commit | 9074d1ed7abe62c388cff7b9effb7b089d2ca3cb (patch) | |
| tree | 70d801ba650fe712ad737fbab8a12f74a36b385a /plugin | |
| parent | Merge pull request #8 from mce35/nut (diff) | |
| parent | Thermal Plugin added (diff) | |
| download | apt-panopticon_cgp-9074d1ed7abe62c388cff7b9effb7b089d2ca3cb.zip apt-panopticon_cgp-9074d1ed7abe62c388cff7b9effb7b089d2ca3cb.tar.gz apt-panopticon_cgp-9074d1ed7abe62c388cff7b9effb7b089d2ca3cb.tar.bz2 apt-panopticon_cgp-9074d1ed7abe62c388cff7b9effb7b089d2ca3cb.tar.xz | |
Merge pull request #9 from ConiKost/master
Collectd Thermal Plugin
Diffstat (limited to 'plugin')
| -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(); | ||
