-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
ibmnos.inc.php
42 lines (42 loc) · 2.2 KB
/
ibmnos.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
* LibreNMS IBM NOS information module
*
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
* 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.
*/
$sysdescr_value = snmp_get($device, "sysDescr.0", "-Ovq");
if (strpos($sysdescr_value, 'IBM Networking Operating System') !== false) {
$hardware = str_replace("IBM Networking Operating System", "", $sysdescr_value);
if (strpos($sysdescr_value, 'G8052') !== false) {
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.26543.100.100.14.9.0", "-Ovq") , '" ');
}
if (strpos($sysdescr_value, 'G8316') !== false) {
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.20301.100.100.14.9.0", "-Ovq") , '" ');
}
if (strpos($sysdescr_value, 'G8264CS') !== false) {
$version = trim(snmp_get($device, ".1.3.6.1.4.1.20301.2.7.15.1.1.1.10.0", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.20301.100.100.14.9.0", "-Ovq") , '" ');
}
if (strpos($sysdescr_value, 'G8264-T') !== false) {
$version = trim(snmp_get($device, ".1.3.6.1.4.1.20301.2.7.13.1.1.1.10.0", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.20301.100.100.14.9.0", "-Ovq") , '" ');
}
if (empty($version)) {
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');
}
if (empty($serial)) {
$serial = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq") , '" ');
}
} elseif (strpos($sysdescr_value, 'IBM Flex System Fabric') !== false) {
$hardware = str_replace("IBM Flex System Fabric", "", $sysdescr_value);
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq") , '" ');
}
?>