Skip to content

Commit

Permalink
Merge pull request #7741 from murrant/two_gets_getHostOS
Browse files Browse the repository at this point in the history
fix: revert to two gets for sysDescr and sysObjectID
  • Loading branch information
Rosiak committed Nov 15, 2017
2 parents e4a775a + d59695f commit e6ba1ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/functions.php
Expand Up @@ -93,9 +93,8 @@ function logfile($string)
*/
function getHostOS($device)
{
$res = snmp_get_multi_oid($device, array('SNMPv2-MIB::sysDescr.0', 'SNMPv2-MIB::sysObjectID.0'));
$sysDescr = isset($res['.1.3.6.1.2.1.1.1.0']) ? $res['.1.3.6.1.2.1.1.1.0'] : '';
$sysObjectId = isset($res['.1.3.6.1.2.1.1.2.0']) ? $res['.1.3.6.1.2.1.1.2.0'] : '';
$sysDescr = snmp_get($device, "SNMPv2-MIB::sysDescr.0", "-Ovq");
$sysObjectId = snmp_get($device, "SNMPv2-MIB::sysObjectID.0", "-Ovqn");

d_echo("| $sysDescr | $sysObjectId | \n");

Expand Down

0 comments on commit e6ba1ee

Please sign in to comment.