Solved

SNMP troubleshooting

Posted on 2006-07-10
9
1,839 Views
Last Modified: 2008-01-09
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
Comment
Question by:jibranilyas
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 5

Assisted Solution

by:xylog
xylog earned 100 total points
ID: 17078077
To see the status of the snmp daemon:

 /etc/init.d/snmpd status


0
 
LVL 57

Accepted Solution

by:
giltjr earned 200 total points
ID: 17078526
issue command:

     netstat -anl

look for something like:

     udp        0      0 0.0.0.0:161                 0.0.0.0:*
0
 
LVL 1

Expert Comment

by:rootcoolk
ID: 17078662
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 1

Assisted Solution

by:rootcoolk
rootcoolk earned 50 total points
ID: 17078777
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
 

Author Comment

by:jibranilyas
ID: 17081414
# /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
 
LVL 5

Expert Comment

by:xylog
ID: 17082797
There is a good FAQ on the net-snmp package here: http://net-snmp.sourceforge.net/docs/FAQ.html
0
 
LVL 1

Assisted Solution

by:ncbowden
ncbowden earned 150 total points
ID: 17082801
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
 

Author Comment

by:jibranilyas
ID: 17082892
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
 
LVL 1

Expert Comment

by:ncbowden
ID: 17083990
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question