php_netsnmpmib Code
PHP extension for browsing the SNMP MIBs
Status: Beta
Brought to you by:
emmedics4
Experimental extension for PHP to read MIBS with net-snmp
*NEEDS* the SNMP extension included in PHP **
For license terms see LICENSE.txt
Execute
./configure --enable-netsnmp_mib
Then:
make && make install
You need to add the row in your PHP.INI
extension=netsnmp_mib.so
In PHP.INI you can add those lines
netsnmp_mib.handle_descriptor=1
Loads also the description from MIBs
netsnmp_mib.handle_label=1
Loads also the label from MIBs
netsnmp_mib.handle_comment=1
Loads also the comment from MIBs
* Function List
netsnmp_get_tree_head()
Gets the first entry of the tree
RETURNS: "netsnmp mib - treepointer" RESOURCE
netsnmp_read( <netsnmp mib - treepointer> )
Reads the content of the pointer
RETURNS: An array with the content of the entry
netsnmp_get_mib_dirs()
Gets the current mib_dirs
RETURNS: PATH String
netsnmp_set_mib_dirs( "(+)<path>" )
Sets the mib dirs PATH (you can add a single one using the + as prefix)
Ex: netsnmp_set_mib_dirs("+/mydir")
RETURNS: The new PATH string
netsnmp_scan_mib_dir("<path>")
Scans the directory for new MIBs (better adding in the MIBs path before)
RETURNS: The number of files scanned or -1 if error
netsnmp_read_all_mibs()
Parses all the mibs
RETURNS: the new head (as netsnmp_get_tree_head)
netsnmp_get_types_array()
RETURNS: An array with ID=>"Var Type"
netsnmp_get_access_array()
RETURNS: An array with ID=>"Access Type"
netsnmp_get_status_array()
RETURNS: An array with ID=>"Status Type"
netsnmp_set_logging( <boolean> )
Enable/Disable the netsnmp error callback, those errors will be
shown as errors with E_USER_WARNING
netsnmp_find( <string> )
Finds the correspecting tree pointer in mib for the <string> requested
Ex: netsnmp_find(".iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance")
RETURNS: "netsnmp mib - treepointer" RESOURCE
"NULL" if syntax is wrong
"False" if not found
(c) 2013 - Marco Serantoni <marco.serantoni@gmail.com>