Files
librenms-librenms/includes/polling/os/panos.inc.php
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

39 lines
1.2 KiB
PHP

<?php
use LibreNMS\RRD\RrdDefinition;
$hardware = trim(snmp_get($device, '1.3.6.1.4.1.25461.2.1.2.2.1.0', '-OQv', '', ''), '" ');
$version = trim(snmp_get($device, '1.3.6.1.4.1.25461.2.1.2.1.1.0', '-OQv', '', ''), '" ');
$serial = trim(snmp_get($device, '1.3.6.1.4.1.25461.2.1.2.1.3.0', '-OQv', '', ''), '" ');
// list(,,,$hardware) = explode (" ", $poll_device['sysDescr']);
$sessions = snmp_get($device, '1.3.6.1.4.1.25461.2.1.2.3.3.0', '-Ovq');
if (is_numeric($sessions)) {
$rrd_def = RrdDefinition::make()->addDataset('sessions', 'GAUGE', 0, 3000000);
$fields = array(
'sessions' => $sessions,
);
$tags = compact('rrd_def');
data_update($device, 'panos-sessions', $tags, $fields);
$graphs['panos_sessions'] = true;
}
$activetunnels = snmp_get($device, '1.3.6.1.4.1.25461.2.1.2.5.1.3.0', '-Ovq');
if (is_numeric($activetunnels)) {
$rrd_def = RrdDefinition::make()->addDataset('activetunnels', 'GAUGE', 0, 3000000);
$fields = array(
'activetunnels' => $activetunnels,
);
$tags = compact('rrd_def');
data_update($device, 'panos-activetunnels', $tags, $fields);
$graphs['panos_activetunnels'] = true;
}