Tony Murray 57650e4ffc Remove nfs requirement for distributed poller (with rrdtool 1.5+)
Use data_update instead of rrd_update/rrd_create and influx_update
Centralize rrd file check so we can check against a remote rrdcached server too
Use rrd_name() to generate rrd file names
2016-07-07 21:10:06 -05:00

34 lines
1.1 KiB
PHP

<?php
/*
* LibreNMS
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
$rssi = snmp_get($device, "CISCO-WAN-3G-MIB::c3gCurrentGsmRssi.13", "-Ovqn", "CISCO-WAN-3G-MIB");
if (is_numeric($rssi)) {
$rrd_def = 'DS:rssi:GAUGE:600:-150:5000';
$fields = array(
'rssi' => $rssi,
);
$tags = compact('rrd_def');
data_update($device, 'cisco-wwan-rssi', $tags, $fields);
$graphs['cisco_wwan_rssi'] = TRUE;
}
$mnc = snmp_get($device, "CISCO-WAN-3G-MIB::c3gGsmMnc.13", "-Ovqn", "CISCO-WAN-3G-MIB");
if (is_numeric($mnc)) {
$rrd_def = 'DS:mnc:GAUGE:600:0:U';
$fields = array(
'mnc' => $mnc,
);
$tags = compact('rrd_def');
data_update($device, 'cisco-wwan-rssi', $tags, $fields);
$graphs['cisco-wwan-mnc'] = TRUE;
}
unset($rrd_def, $rssi, $mnc, $fields, $tags);