refactor: Cisco ASA Polling Performance Improvements (#6139)

This commit is contained in:
Søren Rosiak
2017-03-22 06:22:48 +01:00
committed by Tony Murray
parent 31ae41beed
commit 5cf779c60b
3 changed files with 28 additions and 34 deletions

View File

@@ -8,35 +8,28 @@ over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
poller_modules:
applications: 0
bgp-peers: 0
cisco-asa-firewall: 1
cisco-cbqos: 1
cisco-cef: 1
cisco-mac-accounting: 1
cisco-voice: 1
cisco-remote-access-monitor: 1
cisco-sla: 1
cisco-ipsec-flow-monitor: 1
cipsec-tunnels: 1
cisco-otv: 1
cisco-asa-firewall: 1
cisco-ipsec-flow-monitor: 1
cisco-remote-access-monitor: 1
hr-mib: 0
ipmi: 0
ipSystemStats: 0
ipmi: 0
ntp: 0
ospf: 0
stp: 0
ucd-diskio: 0
ucd-mib: 0
discovery_modules:
arp-table: 0
bgp-peers: 0
cisco-vrf-lite: 0
ntp: 0
stp: 0
cisco-cef: 1
cisco-sla: 1
cisco-mac-accounting: 1
cisco-otv: 1
cisco-pw: 1
cisco-vrf: 1
cisco-vrf-lite: 1
ucd-diskio: 0
vlans: 0
discovery:
- sysDescr_regex:
- '/^Cisco Adaptive Security Appliance/'

View File

@@ -10,25 +10,26 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if (!str_contains($device['hardware'], 'sc')) {
$oids = 'entPhysicalModelName.1 entPhysicalSoftwareRev.1 entPhysicalSerialNum.1 entPhysicalModelName.4 entPhysicalSoftwareRev.4';
$oids = 'entPhysicalModelName.1 entPhysicalSoftwareRev.1 entPhysicalSerialNum.1 entPhysicalModelName.4 entPhysicalSoftwareRev.4';
$data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB');
$data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB');
if (isset($data[1]['entPhysicalSoftwareRev']) && $data[1]['entPhysicalSoftwareRev'] != '') {
if (isset($data[1]['entPhysicalSoftwareRev']) && $data[1]['entPhysicalSoftwareRev'] != '') {
$version = $data[1]['entPhysicalSoftwareRev'];
} elseif (isset($data[4]['entPhysicalSoftwareRev']) && $data[4]['entPhysicalSoftwareRev'] != '') {
} elseif (isset($data[4]['entPhysicalSoftwareRev']) && $data[4]['entPhysicalSoftwareRev'] != '') {
$version = $data[4]['entPhysicalSoftwareRev'];
}
}
if (isset($data[1]['entPhysicalModelName']) && $data[1]['entPhysicalModelName'] != '') {
if (isset($data[1]['entPhysicalModelName']) && $data[1]['entPhysicalModelName'] != '') {
$hardware = $data[1]['entPhysicalModelName'];
} elseif (isset($data[4]['entPhysicalSoftwareRev']) && $data[4]['entPhysicalSoftwareRev'] != '') {
} elseif (isset($data[4]['entPhysicalSoftwareRev']) && $data[4]['entPhysicalSoftwareRev'] != '') {
$hardware = $data[4]['entPhysicalModelName'];
}
}
if (isset($data[1]['entPhysicalSerialNum']) && $data[1]['entPhysicalSerialNum'] != '') {
if (isset($data[1]['entPhysicalSerialNum']) && $data[1]['entPhysicalSerialNum'] != '') {
$serial = $data[1]['entPhysicalSerialNum'];
}
}
if (empty($hardware)) {

View File

@@ -227,7 +227,7 @@ if ($device['os'] === 'f5' && (version_compare($device['version'], '11.2.0', '>=
if ($config['enable_ports_etherlike']) {
echo 'dot3Stats ';
$port_stats = snmpwalk_cache_oid($device, 'dot3StatsEntry', $port_stats, 'EtherLike-MIB');
} else {
} elseif ($device['os'] != 'asa') {
echo 'dot3StatsDuplexStatus';
$port_stats = snmpwalk_cache_oid($device, 'dot3StatsDuplexStatus', $port_stats, 'EtherLike-MIB');
}
@@ -279,7 +279,7 @@ if ($device['os_group'] == 'cisco' && $device['os'] != 'asa') {
$port_stats = snmpwalk_cache_oid($device, 'vmVlan', $port_stats, 'CISCO-VLAN-MEMBERSHIP-MIB');
$port_stats = snmpwalk_cache_oid($device, 'vlanTrunkPortEncapsulationOperType', $port_stats, 'CISCO-VTP-MIB');
$port_stats = snmpwalk_cache_oid($device, 'vlanTrunkPortNativeVlan', $port_stats, 'CISCO-VTP-MIB');
} else {
} elseif ($device['os'] != 'asa') {
$port_stats = snmpwalk_cache_oid($device, 'dot1qPortVlanTable', $port_stats, 'Q-BRIDGE-MIB');
}//end if