Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1849
  • Last Modified:

SNMP troubleshooting

I installed net-snmp on Ubuntu machine, but i can't seem to pull any data from remote snmp agents.
I am using a nagios plugin to test for that, but it timesout.

How can i verify that my SNMP server is running and how do i verify if my SNMP agent is running?
If you can give a way to test my snmp confgurations
Please advise, Thanks.

p.s. when i ran

ps aux | grep snmpd

i didn't get any results... so i am guessing my snmp daemon isn't running...
0
jibranilyas
Asked:
jibranilyas
  • 2
  • 2
  • 2
  • +2
4 Solutions
 
xylogCommented:
To see the status of the snmp daemon:

 /etc/init.d/snmpd status


0
 
giltjrCommented:
issue command:

     netstat -anl

look for something like:

     udp        0      0 0.0.0.0:161                 0.0.0.0:*
0
 
rootcoolkCommented:
Run 'ps' command to see if snmp server is running or not:

# ps -aux | grep snmp

Output:
root   5512  0.0  2.3  5872 3012 pts/0    S    22:04   0:00 /usr/sbin/snmpd

or yuou can  
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
rootcoolkCommented:
Run 'ps' command to see if snmp server is running or not:

# ps -aux | grep snmp

Output:
root   5512  0.0  2.3  5872 3012 pts/0    S    22:04   0:00 /usr/sbin/snmpd

Or you can run following two commands as well:

# lsof -i :199
Output:
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
snmpd   5512 root    4u  IPv4  34432       TCP *:smux (LISTEN)

OR try out netstat command:

# netstat -natv | grep ':199'
Output:
tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN

listing on port 199

TO start service for SNMP Server Run the commands:
# service snmpd start

Make sure snmpd service starts automatically, when linux comes us (add snmpd service):
# chkconfig --add snmpd

Prot for SNMP
# 161/udp SNMP
# 162/udp SNMPTRAP
# 391/tcp SynOptics SNMP Relay Port
# 391/udp SynOptics SNMP Relay Port
# 1993/tcp cisco SNMP TCP port
# 1993/udp cisco SNMP TCP port
0
 
jibranilyasAuthor Commented:
# /etc/init.d/snmpd status
-bash: /etc/init.d/snmpd: No such file or directory

# lsof -i :199
no output, just got the prompt back

# ps -aux | grep snmp
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root     15566  0.0  0.3   3060   748 pts/0    R+   23:11   0:00 grep snmp

#netstat -anl
(only listing udp)

udp        0      0 0.0.0.0:514             0.0.0.0:*
udp        0      0 10.100.1.161:137        0.0.0.0:*
udp        0      0 0.0.0.0:137             0.0.0.0:*
udp        0      0 10.100.1.161:138        0.0.0.0:*
udp        0      0 0.0.0.0:138             0.0.0.0:*

So, it turns out that snmp is not running...


Now, when i do troubleshoot and get snmp running and i want to see if i can get snmp data from remote machines, how do i accomplish that ???
is it as simple as typing
# snmpwalk 10.10.1.100 public
?????

0
 
xylogCommented:
There is a good FAQ on the net-snmp package here: http://net-snmp.sourceforge.net/docs/FAQ.html
0
 
ncbowdenCommented:
I think that the syntax that you want is :

snmpget -v 1 -c <community_name> <ip_address> sysDescr.0

This will pull back the system description for the device if you can contact it via SNMP.

If you are not using SNMP v1, then you may have to modify the -v parameter to 2c or 3, but v1 is fine for most places.

HTH

Nigel.
http://www.bowden-software.com
0
 
jibranilyasAuthor Commented:
thanks ncnbowden.. it worked.

# snmpget -v 2c -c public 10.10.1.150 sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Hardware: x86 Family 6 Model 9 Stepping 5 AT/AT COMPATIBLE - Software: Windows 2000 Version 5.1 (Build 2600 Uniprocessor Free)

It also worked when i put "-v 1" i.e. snmp version 1, so I guess my question is how do i know which version of SNMP is the remote machine (10.10.1.150) is running..  
0
 
ncbowdenCommented:
Its quite tricky to figure out.

Many SNMP agents (as you have seen) will support both V1 & V2C at the same time.

I don't have a definitive answer for you, apart from querying the device (as you have) with both the V1 & V2C parameter from Net-SNMP, and seeing which one answers. In your case, it supports both !

The other answer, I guess, is to consult the vendor docs for the SNMP agent.

HTH

Nigel.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now