topvision - forgot json file (#9640)

Added software version from sysDescr while I was at it
This commit is contained in:
Tony Murray
2019-01-10 12:55:21 -06:00
committed by GitHub
parent 38cdf31c8e
commit d175950141
2 changed files with 50 additions and 1 deletions

View File

@@ -1,3 +1,12 @@
<?php
$serial = snmp_getnext($device, ".1.3.6.1.4.1.32285.11.1.1.2.1.1.1.16", "-OQv");
$hardware = snmp_getnext($device, ".1.3.6.1.4.1.32285.11.1.1.2.1.1.1.18", "-OQv");
preg_match('/hardware version:V([^;]+);software version:V([^;]+);/', $device['sysDescr'], $tv_matches);
if (isset($tv_matches[2])) {
$version = $tv_matches[2];
}
if (isset($tv_matches[1])) {
$hardware = $tv_matches[1];
} else {
$hardware = snmp_getnext($device, ".1.3.6.1.4.1.32285.11.1.1.2.1.1.1.18", "-OQv");
}

40
tests/data/topvision.json Normal file
View File

@@ -0,0 +1,40 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.32285.11.1.1.1.4.1",
"sysDescr": "CC8800D-E;hardware version:V2.2.4;software version:V2.3.0.54-C.BT;firm-Software version:430B3-V2.3.0.17BT;Chip version:BCM3218 2.44, 0.1.13, 0.2.2, 0.2.2",
"sysContact": null,
"version": null,
"hardware": null,
"features": null,
"os": "topvision",
"type": "network",
"serial": null,
"icon": "sumavision.png",
"location": null
}
]
},
"poller": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.32285.11.1.1.1.4.1",
"sysDescr": "CC8800D-E;hardware version:V2.2.4;software version:V2.3.0.54-C.BT;firm-Software version:430B3-V2.3.0.17BT;Chip version:BCM3218 2.44, 0.1.13, 0.2.2, 0.2.2",
"sysContact": "<private>",
"version": "2.3.0.54-C.BT",
"hardware": "2.2.4",
"features": null,
"os": "topvision",
"type": "network",
"serial": "1705CC8800D360039",
"icon": "sumavision.png",
"location": "<private>"
}
]
}
}
}