1

I have c++ application running on Ubuntu. I need to add support to monitoring few application scalar values by snmp. I tried to follow the snmp-net set tutorials , but it didnt work for me.

At the end of the tutorial i run this:

/usr/local/sbin/snmpd -f -L -d -p 9999

In another terminal run this:

snmpget -v2c -c tutget localhost:9999 NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0

but i get: Timeout: No Response from localhost:9999.

however run this:

snmptranslate -Td -M+. -mNET-SNMP-TUTORIAL-MIB -IR nstAgentModuleObject

return the MIB DESC.

in addtional try to run with MIB location like this, return the same.

snmpget -v2c -c tutget -M+ -mNET-SNMP-TUTORIAL-MIB localhost:9999 NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0

Thank you!!!!!

4

3 回答 3

2

Tweak the /etc/init.d/snmpd script so that it runs the binary /usr/local/sbin/snmpd, rather than /usr/sbin/snmpd.

than i run : /etc/init.d/snmpd start

and now it worked (without the 9999 port).

于 2012-08-27T10:24:42.810 回答
0

Your snmpget doesn't know where to look for your MIBs. You need to add -M+/mib_dir/ to your snmpconf before you can do an explicit include of your MIB module.

Example:

snmpget -v2c -M+../mib/ -m+ALL -c tutget localhost:9999

于 2012-08-26T21:27:09.473 回答
0

please try

sudo /usr/local/sbin/snmpd -f -L -d -p 9999

you need root permission to setup a new port

9999 is just a temporal port, if you are not comfortable with this, just try this command

sudo pkill snmpd ;  sudo snmpd -LS 0-6 d

you need to kill the previous snmpd service before you start a new one. I used the net-tutorial package, so I can't use such command

sudo service snmpd stop
sudo service snmpd start
sudo service snmpd restart

but if you are using the ubuntu or Unix-like download package, you can use such command

于 2014-07-02T13:36:00.540 回答