diff options
Diffstat (limited to '')
| -rw-r--r-- | plugin/entropy.php | 37 | 
1 files changed, 37 insertions, 0 deletions
diff --git a/plugin/entropy.php b/plugin/entropy.php new file mode 100644 index 0000000..55159dc --- /dev/null +++ b/plugin/entropy.php  | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | # Collectd Entropy plugin | ||
| 4 | |||
| 5 | require_once $CONFIG['webdir'].'/conf/config.php'; | ||
| 6 | require_once $CONFIG['webdir'].'/type/Default.class.php'; | ||
| 7 | |||
| 8 | ## LAYOUT | ||
| 9 | # entropy/entropy.rrd | ||
| 10 | |||
| 11 | $obj = new Type_Default; | ||
| 12 | $obj->datadir = $CONFIG['datadir']; | ||
| 13 | $obj->path_format = '{host}/{plugin}/{type}.rrd'; | ||
| 14 | $obj->args = array( | ||
| 15 | 'host' => $host, | ||
| 16 | 'plugin' => $plugin, | ||
| 17 | 'pinstance' => $pinstance, | ||
| 18 | 'type' => $type, | ||
| 19 | 'tinstance' => $tinstance, | ||
| 20 | ); | ||
| 21 | $obj->data_sources = array('entropy'); | ||
| 22 | $obj->ds_names = array( | ||
| 23 | 'entropy' => 'Entropy bits', | ||
| 24 | ); | ||
| 25 | $obj->colors = array( | ||
| 26 | 'entropy' => '0000f0', | ||
| 27 | ); | ||
| 28 | $obj->width = $width; | ||
| 29 | $obj->heigth = $heigth; | ||
| 30 | $obj->seconds = $seconds; | ||
| 31 | $obj->rrd_title = "Available entropy on $host"; | ||
| 32 | $obj->rrd_vertical = 'Bits'; | ||
| 33 | $obj->rrd_format = '%4.0lf'; | ||
| 34 | |||
| 35 | $obj->rrd_graph(); | ||
| 36 | |||
| 37 | ?> | ||
