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.
This commit is contained in:
PipoCanaja
2019-04-09 21:03:07 +02:00
committed by Neil Lathwood
parent 0a7b0d4086
commit 5697d24869
7 changed files with 104 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
* 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
@@ -10,12 +11,33 @@
* 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(' ', '', snmp_get($device, 'rlPhdUnitGenParamModelName.1', '-Ovq', 'CISCOSB-Physicaldescription-MIB'));
$hardware = str_replace(' ', '', $data['1']['rlPhdUnitGenParamModelName']);
}
if ($hwversion) {
$hardware .= " " . $hwversion;
}
$version = snmp_get($device, 'rlPhdUnitGenParamSoftwareVersion.1', '-Ovq', 'CISCOSB-Physicaldescription-MIB');
$serial = snmp_get($device, 'rlPhdUnitGenParamSerialNum.1', '-Ovq', 'CISCOSB-Physicaldescription-MIB');
$features = snmp_get($device, 'rlPhdUnitGenParamServiceTag.1', '-Ovq', 'CISCOSB-Physicaldescription-MIB');
$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'];

View File

@@ -43,7 +43,7 @@
"sysObjectID": ".1.3.6.1.4.1.9.6.1.80",
"sysDescr": "Linux, Cisco Systems, Inc WAP371 (WAP371-A-K9), Version 1.3.0.4",
"sysContact": "<private>",
"version": null,
"version": "Software 1.3.0.4",
"hardware": null,
"features": null,
"os": "ciscosb",

View File

@@ -18,6 +18,23 @@
}
]
},
"poller": "matches discovery"
"poller": {
"devices": [
{
"sysName": "",
"sysObjectID": ".1.3.6.1.4.1.9.1.1176",
"sysDescr": "8-port 10/100/1000 Ethernet Switch with PoE",
"sysContact": null,
"version": "Software ",
"hardware": null,
"features": null,
"os": "ciscosb",
"type": "network",
"serial": null,
"icon": "cisco.svg",
"location": null
}
]
}
}
}

View File

@@ -4838,5 +4838,43 @@
}
]
}
},
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.9.6.1.95.10.3",
"sysDescr": "SG350-10 10-Port Gigabit Managed Switch",
"sysContact": null,
"version": null,
"hardware": null,
"features": null,
"os": "ciscosb",
"type": "network",
"serial": null,
"icon": "cisco.svg",
"location": null
}
]
},
"poller": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.9.6.1.95.10.3",
"sysDescr": "SG350-10 10-Port Gigabit Managed Switch",
"sysContact": "<private>",
"version": "Software 1.0.0, Firmware 1.0.0",
"hardware": null,
"features": null,
"os": "ciscosb",
"type": "network",
"serial": null,
"icon": "cisco.svg",
"location": "<private>"
}
]
}
}
}

View File

@@ -18,6 +18,23 @@
}
]
},
"poller": "matches discovery"
"poller": {
"devices": [
{
"sysName": "",
"sysObjectID": ".1.3.6.1.4.1.9.6.1.93.24.1",
"sysDescr": "SG550X-24 24-Port Gigabit Stackable Managed Switch",
"sysContact": null,
"version": "Software ",
"hardware": null,
"features": null,
"os": "ciscosb",
"type": "network",
"serial": null,
"icon": "cisco.svg",
"location": null
}
]
}
}
}

View File

@@ -449,3 +449,4 @@
1.3.6.1.2.1.47.1.1.1.1.15.1|4|
1.3.6.1.2.1.47.1.1.1.1.16.1|2|1
1.3.6.1.4.1.9.6.1.101.1.8.0|2|42
1.3.6.1.4.1.9.6.1.101.53.14.1.2.1|4|1.3.0.4

View File

@@ -519,4 +519,6 @@
1.3.6.1.2.1.31.1.1.1.18.9000|4|
1.3.6.1.2.1.31.1.1.1.18.20000|4|
1.3.6.1.2.1.31.1.1.1.18.100000|4|
1.3.6.1.4.1.9.6.1.101.53.14.1.2.1|4|1.0.0
1.3.6.1.4.1.9.6.1.101.53.14.1.3.1|4|1.0.0
1.3.6.1.6.3.10.2.1.3.0|2|115880