Net::SNMP::Vendor - lookup the Vendor for a sysObjectID based on the IANA list
use Net::SNMP::Vendor; my $sysObjectID = '.220.127.116.11.4.1.0'; my $v = Net::SNMP::Vendor->new; $v->load_cache; my $vendor = $v->lookup(sysid => $sysObjectID);
The Internet Assigned Numbers Association (www.iana.org) maintains a list of all assgined sysObjectID which can be used to determine the vendor of a SNMP agent. Futhermore this ID points usually to an entry in the vendors SMI within the enterprise subtree under '
To obtain the sysObjectID perform a SNMP get_request operation on the SNMP agent for the following OID '
.18.104.22.168.22.214.171.124.0'. The result will be as described above a dotted decimal string with the prefix '
.126.96.36.199.4' followed by the vendors identification ID and the vendor assigned device ID.
You might then either pass the whole string or the extracted vendor ID to the module as described above. If the ID is assigned and in the cache the module will return a hash reference to a vendor object giving all information stored by the IANA for that certain vendor ID. If the ID is unkown the module will return undef. To get the cause for the error you might call the
This module tries to persistently cache with
DBM::Deep the vendor information to avoid obsesive network use. If you prefer not to store the result persistently you might use
Net::SNMP::Vendor::CACHE in combination with the
type option in the constructor. That will cause the module to store the loaded list within a normal hash reference
NOTE: The result will be lost as soon as the process finishes that created the hash.
Creates and returns a blessed reference to a Vendor object. The module can be run in two different modes. The recommended mode is the database mode (set
Net::SNMP::Vendor::DB) which is enabled by default. The other mode is called cache mode (set
If run in the
DB mode the constructor will try to create a
DBM::Deep database either under '
./sysoid.db' or under the location specified through the '
db_dir' and '
db_file' option. If the creation of the database fails the cause for the error can be determined calling the
get_error() function. In this case the type option will be set to
db_optimize option can be used to enforce the release of unused disk space used by the
DBM::Deep object. NOTE: Under rare conditions this sometimes leads to the loss of data. The feature is disabled by default.
CACHE mode means that the list of loaded sysObjectID list will be stored temporarily in a hash reference and the list will be lost when the process finishes.
Loads the list of assigned sysObjectIDs from '
http://www.iana.org/assignments/enterprise-numbers'. Depending on the
type the result is either stored in a
DBM::Deep database or in a hash reference. If not initially loaded the functions first checks if the stored list comply with the current list loaded before updating the database or cache. If an error occurred the function will return
ERROR_SUCCESS is returned.
Tries to lookup the passed sysObjectID. The sysObjectID might be either passed as the whole dotted decimal string or as an unsigned integer to the function. If the function succeeds it will return a hash reference with the sysObjectID corresponding vendor. If not it will return
undef. To determine the error cause call the
Returns the cause for the last error that occured. If no error occured it will return
ERROR_SUCCESS. If the error was caused by another module that was called by the Vendor object there will be additional error information available calling this function.
Returns the date in the style YYYY-MM-DD when the loaded and probably saved list last has been updated by the IANA.
Copyright (c) 2007 Florian Endler. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.