mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
27
includes/definitions/aix.yaml
Normal file
27
includes/definitions/aix.yaml
Normal 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.
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user