PDA

View Full Version : SNMP plugin



mhwlng
April 22nd, 2006, 12:49 AM
Via a link in my sig, you can get a girder 4 plugin to perform an SNMP request (no writing or handling of snmp traps)

the plugin exposes one lua function SNMP.GetRequest and you use it like this :


--ifInOctets 32 bit
print(SNMP.GetRequest (".1.3.6.1.2.1.2.2.1.10.2","192.168.1.1","public"));
--ifOutOctets 32 bit
print(SNMP.GetRequest (".1.3.6.1.2.1.2.2.1.16.2","192.168.1.1","public"));
--name
print(SNMP.GetRequest (".1.3.6.1.2.1.1.5.0","192.168.1.1","public"));

above oid's works with my Zyxel P2602R-63 ADSL2+ broadband router..

the snmp code comes from :
http://www.codeproject.com/internet/MIB_Browser_tool.asp

some useful snmp resources :

http://www.wtcs.org/snmp4tpc/getif.htm

http://www.paessler.com/prtg

http://oss.oetiker.ch/mrtg/


Marcel

Promixis
April 22nd, 2006, 04:50 AM
neat,

I have also seen this http://luaforge.net/projects/luasnmp

mhwlng
May 2nd, 2006, 02:42 AM
I found a buffer overflow problem in the codeproject snmp code, the plugin has been updated...

Marcel

mhwlng
July 26th, 2006, 12:40 AM
I made a minor change to the plugin :
It won't show up in the Event Device dropdown anymore.
If you don't care about this, then there's no need to update...

Marcel