📄 readme
字号:
PHP3 UCD-SNMP ExtensionWhat is it?This is an extension library which ties the ucd-snmp library toPHP3. Only snmpget and snmpwalk are supported at this time. Ifyou need other functions, feel free to add them and send me apatch. (rasmus@lerdorf.on.ca)InstallationYou first need to get a hold of ucd-snmp-3.2. This extension hasn't been tested with any other version.Compile and install it. Make sure the following header files fromthe ucd-3.2/snmplib directory get copied to /usr/local/include, or wherever dl/Makefile tries to include files from.asn1.h, snmp_api.h, snmp_client.h, snmp_impl.h, snmp.h, parse.hThen type: make snmp.sofrom the php3/dl directory.If there is no Makefile, run ./setupYou may also need to add some -I<path> statements to the CC line.How to call it from PHP3On the page where you need to make an SNMP call, load the library: <? dl("<path>/snmp.so"); ?>To fetch an object: <? $value = snmpget("hostname","community","object_id"); ?>For example: snmpget("127.0.0.0","public","system.sysContact.0")The arguments to snmpwalk() are identical. The difference being that thereturned value is an array of snmp objects. You can step through themwith a loop.For example: $a = snmpwalk("127.0.0.0","public",""); for($i=0;$i<count($a);$i++) { echo $a[$i]; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -