JohnSPeach 03e8bd743e Allow F5 APM graphs to display automatically (#9377)
* Update f5.inc.php

RRD file needs to be named bigip_apm_sessions for the graph to automatically appear.

* Update and rename bigip_apm_curr_sessions.inc.php to bigip_apm_sessions.inc.php

It seems that both this file and the RRD file need to be named bigip_apm_sessions for the graphs to appear automatically

* Create 270.sql

Missed this from the original pull request - the graph has to be named bigip_apm_sessions to automatically display
2018-10-25 15:39:45 -05:00

21 lines
690 B
PHP

<?php
$version = trim(snmp_get($device, '.1.3.6.1.4.1.3375.2.1.4.2.0', '-OQv'), '"');
$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.3375.2.1.3.5.2.0', '-OQv'), '"');
$serial = trim(snmp_get($device, '.1.3.6.1.4.1.3375.2.1.3.3.3.0', '-OQv'), '"');
use LibreNMS\RRD\RrdDefinition;
$sessions = snmp_get($device, 'apmAccessStatCurrentActiveSessions.0', '-OQv', 'F5-BIGIP-APM-MIB');
if (is_numeric($sessions)) {
$rrd_def = RrdDefinition::make()->addDataset('sessions', 'GAUGE', 0);
$fields = array(
'sessions' => $sessions,
);
$tags = compact('rrd_def');
data_update($device, 'bigip_apm_sessions', $tags, $fields);
$graphs['bigip_apm_sessions'] = true;
}