From a387193f4f18d872d45db4fa7d9261f50aebbc73 Mon Sep 17 00:00:00 2001 From: Manuel CISSÉ Date: Tue, 23 Feb 2010 17:41:00 +0100 Subject: add ping plugin --- plugin/ping.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 plugin/ping.php diff --git a/plugin/ping.php b/plugin/ping.php new file mode 100644 index 0000000..088cf03 --- /dev/null +++ b/plugin/ping.php @@ -0,0 +1,45 @@ +.rrd +# ping/ping_stddev-.rrd +# ping/ping_droprate-.rrd + +$obj = new Type_Default($CONFIG); +$obj->data_sources = array('value'); +$obj->ds_names = array('ping' => 'Ping time', + 'ping_stddev' => 'Ping stddev', + 'ping_droprate' => 'Ping droprate'); +$obj->width = $width; +$obj->heigth = $heigth; +$obj->generate_colors(); +switch($obj->args['type']) { + case 'ping': + $obj->data_sources = array('ping'); + $obj->rrd_title = 'Ping latency'; + $obj->rrd_vertical = 'Milliseconds'; + $obj->rrd_format = '%5.1lf'; + break; + case 'ping_stddev': + $obj->rrd_title = 'Ping stddev'; + $obj->rrd_vertical = ''; + $obj->rrd_format = '%5.1lf'; + break; + case 'ping_droprate': + $obj->rrd_title = 'Ping droprate'; + $obj->rrd_vertical = ''; + $obj->rrd_format = '%5.1lf'; + break; +} + +collectd_flush($obj->identifiers); +$obj->rrd_graph(); + +?> -- cgit v1.1