blob: 1aae16c471a7b22acaa97579d141dec5a826e7b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<?php
# Collectd NTPD plugin
require_once 'conf/common.inc.php';
require_once 'type/Default.class.php';
require_once 'inc/collectd.inc.php';
## LAYOUT
# ntpd/
# ntpd/delay-<host>.rrd
# ntpd/frequency_offset-loop.rrd
# ntpd/time_dispersion-<host>.rrd
# ntpd/time_offset-<host>.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();
?>
|