2011-09-30 00:19:48 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// Polls ntp-client statistics from script via SNMP
|
2011-09-30 00:19:48 +00:00
|
|
|
|
2011-10-01 10:10:02 +00:00
|
|
|
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
|
|
|
|
$options = "-O qv";
|
|
|
|
$oid = "nsExtendOutputFull.9.110.116.112.99.108.105.101.110.116";
|
2011-09-30 00:19:48 +00:00
|
|
|
|
2011-10-01 10:10:02 +00:00
|
|
|
$ntpclient = snmp_get($device, $oid, $options);
|
2011-09-30 00:19:48 +00:00
|
|
|
|
|
|
|
echo(" ntp-client");
|
|
|
|
|
|
|
|
list ($offset, $frequency, $jitter, $noise, $stability) = explode("\n", $ntpclient);
|
|
|
|
|
2011-10-01 10:10:02 +00:00
|
|
|
if (!is_file($rrd_filename))
|
|
|
|
{
|
|
|
|
rrdtool_create($rrd_filename, "--step 300 \
|
2011-10-02 09:41:55 +00:00
|
|
|
DS:offset:GAUGE:600:-1000:1000 \
|
|
|
|
DS:frequency:GAUGE:600:-1000:1000 \
|
|
|
|
DS:jitter:GAUGE:600:-1000:1000 \
|
|
|
|
DS:noise:GAUGE:600:-1000:1000 \
|
2012-04-20 17:37:58 +00:00
|
|
|
DS:stability:GAUGE:600:-1000:1000 ".$config['rrd_rra']);
|
2011-09-30 00:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rrdtool_update($rrd_filename, "N:$offset:$frequency:$jitter:$noise:$stability");
|
|
|
|
|
|
|
|
?>
|