note 91789 added to function.snmpget

From: Date: Thu, 25 Jun 2009 13:23:11 +0000
Subject: note 91789 added to function.snmpget
Groups: php.notes 
Request: Send a blank email to php-notes+get-157496@lists.php.net to get a copy of this message
This function can be used to identify devices on a network, by getting their sysObjectID and sysDescr. On short, this is what I did: <?php $sysid = @snmpget($ip, 'public', '.1.3.6.1.2.1.1.2.0', 300); if($sysid) { $sysdescr = @snmpget($ip, 'public', '.1.3.6.1.2.1.1.1.0', 300); } ?> What I get for equipments, for example: <?php $sysid = 'OID: .iso.3.6.1.4.1.5003.8.1.1.57';// => AudioCodes MP114; //.iso.3.6.1.4.1. is a "prefix" for the OID domain //5003 is the IANA number for AudioCodes //8.1.1.57 identifies the equipment type (MP-114) $sysdescr = '"Product: MP-114 FXS;SW Version: 5.00A.024"'; ?> Unfortunately, not all of them report correct objectID, for example they report only the vendor and stop there etc. In case you are wondering why I used the code '.1.3.6.1.2.1.1.2.0' in the function call instead of "sysObjectID.0", it's because only numeric codes seem to work on Windows. For more codes, google "cisco SNMP Object Navigator". Have fun. ---- Server IP: 209.41.74.194 Probable Submitter: 89.35.129.81 ---- Manual Page -- http://www.php.net/manual/en/function.snmpget.php Edit -- https://master.php.net/note/edit/91789 Del: integrated -- https://master.php.net/note/delete/91789/integrated Del: useless -- https://master.php.net/note/delete/91789/useless Del: bad code -- https://master.php.net/note/delete/91789/bad+code Del: spam -- https://master.php.net/note/delete/91789/spam Del: non-english -- https://master.php.net/note/delete/91789/non-english Del: in docs -- https://master.php.net/note/delete/91789/in+docs Del: other reasons-- https://master.php.net/note/delete/91789 Reject -- https://master.php.net/note/reject/91789 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#157496) next »