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
|
2015-07-10 13:36:21 +02: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
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$ntpclient = snmp_get($device, $oid, $options);
|
2011-09-30 00:19:48 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
echo ' ntp-client';
|
2011-09-30 00:19:48 +00:00
|
|
|
|
|
|
|
list ($offset, $frequency, $jitter, $noise, $stability) = explode("\n", $ntpclient);
|
|
|
|
|
2015-07-10 13:36:21 +02: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 \
|
2015-07-10 13:36:21 +02:00
|
|
|
DS:stability:GAUGE:600:-1000:1000 '.$config['rrd_rra']
|
|
|
|
);
|
2011-09-30 00:19:48 +00:00
|
|
|
}
|
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
rrdtool_update($rrd_filename, "N:$offset:$frequency:$jitter:$noise:$stability");
|