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
|
|
|
$options = '-O qv';
|
|
|
|
$oid = 'nsExtendOutputFull.9.110.116.112.99.108.105.101.110.116';
|
|
|
|
$ntpclient = snmp_get($device, $oid, $options);
|
2011-09-30 00:19:48 +00:00
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$name = 'ntpclient';
|
|
|
|
$app_id = $app['app_id'];
|
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);
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_name = array('app', $name, $app_id);
|
|
|
|
$rrd_def = array(
|
|
|
|
'DS:offset:GAUGE:600:-1000:1000',
|
|
|
|
'DS:frequency:GAUGE:600:-1000:1000',
|
|
|
|
'DS:jitter:GAUGE:600:-1000:1000',
|
|
|
|
'DS:noise:GAUGE:600:-1000:1000',
|
|
|
|
'DS:stability:GAUGE:600:-1000:1000'
|
|
|
|
);
|
2011-09-30 00:19:48 +00:00
|
|
|
|
2015-08-18 16:26:55 +00:00
|
|
|
$fields = array(
|
2016-07-07 01:33:43 -05:00
|
|
|
'offset' => $offset,
|
|
|
|
'frequency' => $frequency,
|
|
|
|
'jitter' => $jitter,
|
|
|
|
'noise' => $noise,
|
|
|
|
'stability' => $stability,
|
2015-08-18 16:26:55 +00:00
|
|
|
);
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
|
|
|
data_update($device, 'app', $tags, $fields);
|
2015-08-19 20:58:02 +00:00
|
|
|
|