48 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/*
2015-07-13 20:10:26 +02:00
* 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 = $poll_device['sysDescr'];
2015-02-14 17:20:56 +01:00
if (strpos($sysdescr_value, 'IBM Networking Operating System') !== false) {
2015-07-13 20:10:26 +02:00
$hardware = str_replace('IBM Networking Operating System', '', $sysdescr_value);
2015-02-14 17:20:56 +01:00
if (strpos($sysdescr_value, 'G8052') !== false) {
2015-07-13 20:10:26 +02:00
$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'), '" ');
2015-02-14 17:20:56 +01:00
}
2015-07-13 20:10:26 +02:00
2015-02-14 17:20:56 +01:00
if (strpos($sysdescr_value, 'G8316') !== false) {
2015-07-13 20:10:26 +02:00
$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'), '" ');
2015-02-14 17:20:56 +01:00
}
2015-07-13 20:10:26 +02:00
2015-02-14 17:20:56 +01:00
if (strpos($sysdescr_value, 'G8264CS') !== false) {
2015-07-13 20:10:26 +02:00
$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'), '" ');
2015-02-14 17:20:56 +01:00
}
2015-07-13 20:10:26 +02:00
2015-02-14 17:20:56 +01:00
if (strpos($sysdescr_value, 'G8264-T') !== false) {
2015-07-13 20:10:26 +02:00
$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'), '" ');
2015-02-14 17:20:56 +01:00
}
2015-07-13 20:10:26 +02:00
if (empty($version)) {
2015-07-13 20:10:26 +02:00
$version = trim(snmp_get($device, '.1.3.6.1.2.1.47.1.1.1.1.10.1', '-Ovq'), '" ');
}
2015-07-13 20:10:26 +02:00
if (empty($serial)) {
2015-07-13 20:10:26 +02:00
$serial = trim(snmp_get($device, '.1.3.6.1.2.1.47.1.1.1.1.11.1', '-Ovq'), '" ');
}
2015-02-14 17:20:56 +01:00
}
2015-07-13 20:10:26 +02:00
else if (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'), '" ');
}//end if