From 43d73b6ee3c29a379f09a741eb8a19d677cb3ef9 Mon Sep 17 00:00:00 2001 From: Manuel CISSÉ Date: Tue, 23 Feb 2010 18:22:18 +0100 Subject: add ntpd plugin --- plugin/ntpd.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 plugin/ntpd.php diff --git a/plugin/ntpd.php b/plugin/ntpd.php new file mode 100644 index 0000000..1aae16c --- /dev/null +++ b/plugin/ntpd.php @@ -0,0 +1,53 @@ +.rrd +# ntpd/frequency_offset-loop.rrd +# ntpd/time_dispersion-.rrd +# ntpd/time_offset-.rrd + +$obj = new Type_Default($CONFIG); +$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 'delay': + $obj->data_sources = array('seconds'); + $obj->rrd_title = sprintf('Delay'); + $obj->rrd_vertical = 'Seconds'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'frequency_offset': + $obj->data_sources = array('ppm'); + $obj->rrd_title = 'Frequency offset'; + $obj->rrd_vertical = 'ppm'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'time_dispersion': + $obj->data_sources = array('seconds'); + $obj->rrd_title = 'Time dispersion'; + $obj->rrd_vertical = 'Seconds'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'time_offset': + $obj->data_sources = array('seconds'); + $obj->rrd_title = 'Time offset'; + $obj->rrd_vertical = 'Seconds'; + $obj->rrd_format = '%5.1lf%s'; + break; +} + +collectd_flush($obj->identifiers); +$obj->rrd_graph(); + +?> -- cgit v1.1