Files
librenms-librenms/includes/polling/applications/os-updates.inc.php
T
Neil Lathwood fad5aca1b7 feature: Allow customisation of rrd step/heartbeat when creating new rrd files (#5947)
* feature: Allow customisation of rrd step/heartbeat when creating new rrd files

* revert defaults

* added docs + webui config option

* Move RrdDefinition to an Object to make them easier to create and remove the possibility of typos.

* Fix style/lint issues and missing use statements

* 3 more missing use statements

* updated doc + moved schema file
2017-02-23 22:45:50 +00:00

19 lines
572 B
PHP

<?php
use LibreNMS\RRD\RrdDefinition;
$name = 'os-updates';
$app_id = $app['app_id'];
$options = '-O qv';
$mib = 'NET-SNMP-EXTEND-MIB';
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.111.115.117.112.100.97.116.101.1';
$rrd_name = array('app', $name, $app_id);
$rrd_def = RrdDefinition::make()->addDataset('packages', 'GAUGE', 0);
$osupdates = snmp_get($device, $oid, $options, $mib);
$fields = array('packages' => $osupdates,);
$tags = array('name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name);
data_update($device, 'app', $tags, $fields);