snmpd-pyagentx Code
Status: Beta
Brought to you by:
fraggod
Requirements: ------------- Net-SNMP (http://net-snmp.sourceforge.net/) headers and libs (libnetsnmp*). Counter64 type export doesn't seem to work with snmpd-5.2.3 at the moment, but works with snmpd-5.4 versions correctly. AFAIK 64-bit support appeared somewhere around 5.2, so it might be a bug of that version. Installation: ------------- Basically, it's just $ python3 ./setup.py install To install for unprivileged user, use ~/.pydistutils.cfg: [install] install_lib = ~/.python install_scripts = ~/bin ...and set PATH / PYTHONPATH to include these: echo PATH="$HOME/bin:$PATH" >> ~/.bashrc echo PYTHONPATH="$HOME/.python:$PYTHONPATH" >> ~/.bashrc Notes: ------------- Check out "examples" path for sample code: static_data.py - serves static data from dict on a given oid cpu_load.py process_stats.py - dynamically poll/serve real system data ext_server.py - compose and serve all of the above (via ExtensionStack) Note that for AgentX to work with net-snmp, you'd need to explicitly enable it in snmpd.conf via "master agentx" directive. See snmpd.conf(5). Sample (bare-basic) snmpd.conf: rocommunity PASS syslocation Right here syscontact me@somewhere.net master agentx To try it all out: $ cd examples $ ./ext_server.py & $ snmpwalk -v2c -cPASS localhost UCD-SNMP-MIB::ucdavis.50 Links: ------------- http://snmpd-pyagentx.sf.net/ http://sf.net/projects/snmpd-pyagentx/