add AIX detection running std snmpd or net-snmp (#10569)

* update IBM mibs
* add AIX detection running std snmpd or net-snmp
* simplifying  complex logical expression, codeclim.
This commit is contained in:
fbourqui
2019-09-02 22:08:05 +02:00
committed by PipoCanaja
parent 4fdf1618a1
commit c73e9cbcfb
65 changed files with 439747 additions and 51 deletions

View File

@@ -0,0 +1,27 @@
os: aix
text: 'AIX'
type: server
icon: aix
group: unix
mib_dir:
- ibm
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
poller_modules:
bgp-peers: false
ospf: false
stp: false
discovery_modules:
applications: false
bgp-peers: false
stp: false
vmware-vminfo: false
libvirt-vminfo: false
wireless: false
processor_stacked: true
discovery:
- sysObjectID:
- .1.3.6.1.4.1.8072.3.2.15
- .1.3.6.1.4.1.2.3.1.

View File

@@ -1,8 +1,8 @@
<?php
if ($device['os'] == "linux" || $device['os'] == "endian" || $device['os'] == "proxmox" || $device['os'] == "recoveryos") {
if (in_array($device['os'], array("linux", "endian", "proxmox", "recoveryos"))) {
list(,,$version) = explode(" ", $device['sysDescr']);
if (strstr($device['sysDescr'], "386")|| strstr($device['sysDescr'], "486")||strstr($device['sysDescr'], "586")||strstr($device['sysDescr'], "686")) {
if (preg_match('[3-6]86', $device['sysDescr'])) {
$hardware = "Generic x86";
} elseif (strstr($device['sysDescr'], "x86_64")) {
$hardware = "Generic x86 64-bit";
@@ -159,4 +159,16 @@ if ($device['os'] == "linux" || $device['os'] == "endian" || $device['os'] == "p
$output = preg_split("/ /", $device['sysDescr']);
$version = $output[2];
$hardware = $output[6];
} elseif ($device['os'] == "aix") {
$aix_descr = explode("\n", $device['sysDescr']);
# AIX standard snmp deamon
if ($aix_descr[1]) {
$serial = explode("Processor id: ", $aix_descr[1])[1];
$aix_long_version = explode("AIX version: ", $aix_descr[2])[1];
list($version,$aix_version_min) = array_map('intval', explode(".", $aix_long_version));
# AIX net-snmp
} else {
list(,,$aix_version_min,$version,$serial) = explode(" ", $aix_descr[0]);
}
$version .= "." . $aix_version_min;
}