Skip to content
Barry O'Donovan edited this page Feb 27, 2017 · 7 revisions

A new feature of OSS_SNMP is device discovery - specifically the discovery of a devices vendor, model, operating system and related details. The kind of details that are presented differently between vendors and, most annoying, within the same vendor.

The purpose of device discovery is to allow for the discovery of this information without knowing anything but the device IP address and SNMP community.

An Example

$snmpHost = new \OSS_SNMP\SNMP( $ip, $community );

echo "Vendor:      " . $snmpHost->getPlatform()->getVendor() 
    . "Model:      " . $snmpHost->getPlatform()->getModel() 
    . "OS:         " . $snmpHost->getPlatform()->getOs() 
    . "OS Version: " . $snmpHost->getPlatform()->getOsVersion();

See the platform API for full details.

Also, see this example script.

Supported Devices

Like MIBS, this is only as useful as the number of devices support. So, please write some code and open a pull request. You'll find examples in this directory. Particularly look at the first two written: Brocade and MRV.

You'll notice that the system description MIB is available always via $sysDescr and the system object ID is available via $sysObjectID; but you can also query the host via SNMP as demonstrated in the MRV example.

NB: If $sysDescr and $sysObjectID are insufficient for identifying the host in an if() statement, please contact me as these host discovery plugins should not make SNMP calls to identify the host as being of a particular vendor. Instead, we'll make additional calls before the plugins are called and make that information available in the same was as $sysDescr and $susObjectID.

Adding New Devices

Literally, just copy one of the files mentioned above and edit as appropriate. Nothing else required.

If you can't do this yourself, then please open a new issue and provide:

  • switch make, model, OS name and version

  • the output of:

    snmpget -c $community -On -v 2c $hostname .1.3.6.1.2.1.1.1.0
    snmpget -c $community -On -v 2c $hostname .1.3.6.1.2.1.1.2.0
    
  • if you want to record the serial number and your device supports it, then the OID and a sample response for that also. E.g. on a Brocade FESX it's:

    snmpget -c $community -On -v 2c $hostname .1.3.6.1.4.1.1991.1.1.1.1.2.0
    
Clone this wiki locally