Files
priiduonu a1999c42e2 device: Updated moxa-etherdevice hardware/software/version detection
* Update moxa-etherdevice.inc.php

Would rather rely on `sysObjectID` when getting the hardware/software information as the `sysDescr` may be changed through the web interface of the device. Use numeric OID-s only.

* Update moxa-etherdevice.inc.php

Converted separate `snmp_get` calls into a single `snmp_get_multi_oid` call.

* Update moxa-etherdevice.inc.php

Unset variables at the end.

* Update moxa-etherdevice.inc.php

Unset multiple variables at once.

* Update moxa-etherdevice.inc.php
2018-03-25 21:57:13 +01:00

26 lines
756 B
PHP

<?php
/*
* LibreNMS
*
* Copyright (c) 2017 Aldemir Akpinar <aldemir.akpinar@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.
*/
$oids = array(
'hardware' => $device['sysObjectID'].'.1.2.0',
'version' => $device['sysObjectID'].'.1.4.0',
'serial' => $device['sysObjectID'].'.1.78.0',
);
$os_data = snmp_get_multi_oid($device, $oids);
foreach ($oids as $var => $oid) {
$$var = trim($os_data[$oid], '"');
}
unset($oids, $os_data);