Files
librenms-librenms/includes/polling/os/ciscosb.inc.php
PipoCanaja 5697d24869 Added Cisco Small business bootloader + HW version (#10043)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [X] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2019-04-09 20:03:07 +01:00

44 lines
1.7 KiB
PHP

<?php
/*
* LibreNMS Cisco Small Business OS information module
*
* Copyright (c) 2015 Mike Rostermund <mike@kollegienet.dk>
* Copyright (c) 2019 PipoCanaja (github.com/pipocanaja)
* 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.
*/
$data = snmp_get_multi($device, ['genGroupHWVersion.0', 'rlPhdUnitGenParamModelName.1', 'rlPhdUnitGenParamHardwareVersion.1', 'rlPhdUnitGenParamSerialNum.1', 'rlPhdUnitGenParamSoftwareVersion.1', 'rlPhdUnitGenParamFirmwareVersion.1'], '-OQUs', 'CISCOSB-DEVICEPARAMS-MIB:CISCOSB-Physicaldescription-MIB');
$hardware = $data['1']['rlPhdUnitGenParamHardwareVersion'] . " " . $data['1']['rlPhdUnitGenParamSoftwareVersion'];
$serial = $data['1']['rlPhdUnitGenParamSerialNum'];
$hwversion = $data['0']['genGroupHWVersion'];
if (! $hwversion) {
$hwversion = $data['1']['rlPhdUnitGenParamHardwareVersion'];
}
if ($device['sysObjectID'] == '.1.3.6.1.4.1.9.6.1.89.26.1') {
$hardware = 'SG220-26';
} else {
$hardware = str_replace(' ', '', $data['1']['rlPhdUnitGenParamModelName']);
}
if ($hwversion) {
$hardware .= " " . $hwversion;
}
$version = 'Software ' . $data['1']['rlPhdUnitGenParamSoftwareVersion'];
$boot = $data['0']['rndBaseBootVersion'];
$firmware = $data['1']['rlPhdUnitGenParamFirmwareVersion'];
if ($boot) {
$version = "$version, Bootldr $boot";
}
if ($firmware) {
$version = "$version, Firmware $firmware";
}
$features = $data['1']['rlPhdUnitGenParamServiceTag'];