refactor: Don't do unneeded snmp queries (#7841)

* Don't do uneeded snmp queries
sensors discovery 26 -> 16
wrapped some poller modules in db checks.  The same could be done for some others, but more work is needed.

* travis fix
This commit is contained in:
Tony Murray
2017-12-02 17:18:45 -06:00
committed by Neil Lathwood
parent 5405498ed6
commit b9dc7773d7
12 changed files with 152 additions and 138 deletions

View File

@@ -5,7 +5,9 @@ use LibreNMS\RRD\RrdDefinition;
if ($device['os_group'] == 'cisco') {
// FIXME - seems to be broken. IPs appear with leading zeroes.
$ipsec_array = snmpwalk_cache_oid($device, 'cipSecTunnelEntry', array(), 'CISCO-IPSEC-FLOW-MONITOR-MIB');
$ike_array = snmpwalk_cache_oid($device, 'cikeTunnelEntry', array(), 'CISCO-IPSEC-FLOW-MONITOR-MIB');
if (!empty($ipsec_array)) {
$ike_array = snmpwalk_cache_oid($device, 'cikeTunnelEntry', array(), 'CISCO-IPSEC-FLOW-MONITOR-MIB');
}
$tunnels_db = dbFetchRows('SELECT * FROM `ipsec_tunnels` WHERE `device_id` = ?', array($device['device_id']));
foreach ($tunnels_db as $tunnel) {