LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2012, 03:07 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
snmpwalk command not show appropriate output.


hi,
I am going to configure MRTG on my system. To install it I use

Code:
# yum install mrtg net-snmp net-snmp-utils

To determine if snmp server is running or not

Quote:
# ps -aux | grep snmp
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 15903 0.3 0.1 26628 5284 ? Sl 12:47 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd.pid -a
root 15908 0.0 0.0 4012 684 pts/1 S+ 12:48 0:00 grep snmp

Alternate I use

Code:
# lsof -i :199
COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
snmpd   15903 root    9u  IPv4  47423       TCP 127.0.0.1:smux (LISTEN)

The problem is wheh I use "snmpwalk" command it show me the following error.

Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

getaddrinfo: localhost Name or service not known
snmpwalk: Unknown host (localhost)
[root@pdc-proxy ~]#

I ven change local host with pdc-proxy but no success.

Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public pdc-proxy IP-MIB::ipAdEntIfIndex
Timeout: No Response from pdc-proxy
[root@pdc-proxy ~]#


Please guide me how can I fix the issues.

thanks
gardenair
 
Old 09-17-2012, 03:29 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by gardenair
getaddrinfo: localhost Name or service not known
This raises my suspicion something is wrong with your IP resolving. First try to ping localhost.
When that fails, try to resolve that problem. In any case, try to use 127.0.0.1 as host in snmpwalk and see what happens.

jlinkels
 
Old 09-17-2012, 04:15 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks "jlinkels" for your kind reply. Well I have tried

Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public 192.168.1.10 IP-MIB::ipAdEntIfIndex
[root@pdc-proxy ~]#
as well

Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public 127.0.0.1 IP-MIB::ipAdEntIfIndex
[root@pdc-proxy ~]#
No output.I am not sure it is a DNS issue which is not resolving.Ok if we assume that it is a DNS issue then at least it should show any output when i use 127.0.0.1 in localhost.

I have you jet edit snmpd.conf file. Is thers need to 1st make some nessary changes and then use snmpwalk command ?



gards
gardenair

Last edited by gardenair; 09-17-2012 at 04:22 AM.
 
Old 09-17-2012, 06:19 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
thanks "jlinkels" for your kind reply. Well I have tried

Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public 192.168.1.10 IP-MIB::ipAdEntIfIndex
[root@pdc-proxy ~]#
as well
Code:
[root@pdc-proxy ~]# snmpwalk -v 1 -c public 127.0.0.1 IP-MIB::ipAdEntIfIndex
[root@pdc-proxy ~]#
No output.I am not sure it is a DNS issue which is not resolving.Ok if we assume that it is a DNS issue then at least it should show any output when i use 127.0.0.1 in localhost.

I have you jet edit snmpd.conf file. Is thers need to 1st make some nessary changes and then use snmpwalk command ?
Instead of running all those commands in your first post, have you just run "/etc/init.d/snmpd status"?? Have you tried running "/etc/init.d/snmpd restart", to see if you have any configuration errors? You don't say what version/distro of Linux you're using, but was SNMP ever working on this system? Has it been configured, and if so, are you sure the RO string you specified is correct?? Did you check the snmpd.conf file?
 
Old 09-17-2012, 12:33 PM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
well every thing is correct only snmpd.conf is not configured.One thing is confusing me that
my full computer name is

Code:
srv1.test.local
Code:
and my system IP is 192.168.1.10
and subnetmask is 255.255.255.0
In

[root@srv1 ~]# vi /etc/snmp/snmpd.conf

Here under the line

Code:
com2sec local localhost public
com2sec srv1.test.local 192.168.1.0/24 public
please guide me that is it correct.I have to remove the line
com2sec local localhost public
and write
com2sec srv1.test.local 192.168.1.0/24 public

Please guide me which one is correct ?

gardenair
 
Old 09-17-2012, 12:48 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
cat /etc/hosts
output please.
 
Old 09-17-2012, 12:57 PM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
# cat /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.1.10 srv1.test.local srv1
::1 localhost6.localdomain localhost6


But it is not the answer of my problem.

thanks

Last edited by gardenair; 09-17-2012 at 01:03 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] show only one output sunilsagar Programming 2 09-08-2011 02:10 AM
[SOLVED] xfce4-panel - show output of command? jsteel Linux - General 4 02-21-2011 01:24 PM
bash: snmpwalk: command not found no1san Linux - Newbie 6 09-26-2010 04:36 AM
cmake or make: debug output, show command Ephracis Programming 4 03-01-2008 03:28 AM
How can I page the output of the show tech command on my cisco 2950? abefroman Linux - Networking 1 12-17-2007 06:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration