Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
$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.
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.
$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
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 .18.104.22.168.22.214.171.124.0 snmpget -c $community -On -v 2c $hostname .126.96.36.199.188.8.131.52.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 .184.108.40.206.4.1.19220.127.116.11.1.2.0