LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   snmpwalk not working for localhost (https://www.linuxquestions.org/questions/linux-newbie-8/snmpwalk-not-working-for-localhost-733856/)

gitecravirs 06-18-2009 05:21 AM

snmpwalk not working for localhost
 
Hi Everybody,
I have ubuntu-8.04(2.6.24-23-generic) os and my network interface is only ipv6 i.e. on eth0 interface ipv6 address(2001:468::3) is available. I am able to get statistics of remote host-system by following command--->
# snmpwalk -v2c -c public udp6:[2000:ffff::192.168.1.2] system
But I am unable to get the statics of localhost and getting following output when i run this command
# snmpwalk -v2c -c public localhost system
o/p->Timeout: No Response from localhost
Please help me, where im doing wrong thing and how to get snmpwalk for localhost?
Thanks Alot...

EricTRA 06-18-2009 05:24 AM

Hello,

Do you have snmp server installed on your Ubuntu? That's a prerequisite in order to be able to query your localhost. If it doesn't have an snmpd in the ps -ef then there's nobody home on localhost to reply to your questions. ;)

Kind regards,

Eric

gitecravirs 06-18-2009 06:01 AM

Quote:

Originally Posted by EricTRA (Post 3578127)
Hello,

Do you have snmp server installed on your Ubuntu? That's a prerequisite in order to be able to query your localhost. If it doesn't have an snmpd in the ps -ef then there's nobody home on localhost to reply to your questions. ;)

Kind regards,

Eric

Thanks for giving your precious time...
Ya snmpd server is installed on my ubuntu.I checked it by command " ps -A | grep snmp " and i got this line---> ps -A | grep snmp
6978 ? 00:00:00 snmpd

EricTRA 06-18-2009 06:09 AM

No problem, glad to help out if I can.

Did you set the community string on the server-side? Is the snmp server accepting connections on localhost? Is localhost defined correctly in the hosts file? Check with netstat -al if it's listening...

gitecravirs 06-18-2009 06:26 AM

Quote:

Originally Posted by EricTRA (Post 3578190)
No problem, glad to help out if I can.

Did you set the community string on the server-side? Is the snmp server accepting connections on localhost? Is localhost defined correctly in the hosts file? Check with netstat -al if it's listening...

Ya i have set the rocommunity on server side,localhost is also defined in /etc/hosts
I did "netstat -an | grep :161" and its listening on port no. 161,i dint understand ur 2nd question i.e. whether snmp server accepting connection on localhost?
shall i show you my /etc/snmp/snmpd.conf file? i checked "netstat -al" also but im not understanding its output.

EricTRA 06-18-2009 06:31 AM

Sure, if you send me your config file I'll take a look at it. Also the output of netstat -al would tell me something.

I'm leaving office in one hour (14:30). I'll try to take a look at it at home and if not then tomorrow.

Kind regards,

Eric

gitecravirs 06-18-2009 07:00 AM

Quote:

Originally Posted by EricTRA (Post 3578205)
Sure, if you send me your config file I'll take a look at it. Also the output of netstat -al would tell me something.

I'm leaving office in one hour (14:30). I'll try to take a look at it at home and if not then tomorrow.

Kind regards,
Eric

Okay Thanks Alot..
my /etc/snmp/snmpd.conf file contains--->
###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]

rocommunity public
rocommunity public
rocommunity public
###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the "system" mib group in the mibII tree.

# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)

# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
#
# Unknown directives read in from other files by snmpconf
#
rocommunity6 public
rocommunity6 public
com2sec readonly default public
com2sec local localhost public
com2sec6 localnet 2001:468::3 public
com2sec6 readonly default public
com2sec6 local localhost public

group MyROSystem v1 local
group MyROSystem v2c local
group MyROSystem usm local
group MyROGroup v1 localnet
group MyROGroup v2c localnet
group MyROGroup usm localnet
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
view all included .1 80
view system included .iso.org.dod.internet.mgmt.mib-2.system
access MyROSystem "" any noauth exact system none none
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none
and "netstat -al" output is below---->
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp6 0 0 :::5900 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:40500 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:631 0.0.0.0:*
udp6 0 0 :::161 :::*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 14022 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 15049 @/tmp/dbus-FJAvNr8eDl
unix 2 [ ACC ] STREAM LISTENING 14545 /tmp/orbit-prithvi/linc-1605-0-57cc894e145e9
unix 2 [ ACC ] STREAM LISTENING 14555 /tmp/orbit-prithvi/linc-1603-0-6cf1195a274cb
unix 2 [ ACC ] STREAM LISTENING 14809 /tmp/keyring-en8uQa/socket
unix 2 [ ACC ] STREAM LISTENING 14811 /tmp/keyring-en8uQa/ssh
unix 2 [ ACC ] STREAM LISTENING 14813 /tmp/keyring-en8uQa/socket.pkcs11
unix 2 [ ACC ] STREAM LISTENING 14962 /tmp/orbit-prithvi/linc-1608-0-28b3d06ee0703
unix 2 [ ACC ] STREAM LISTENING 14993 /tmp/seahorse-K4JM3w/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 15031 /tmp/orbit-prithvi/linc-1608-0-46672ca781e70
unix 2 [ ACC ] STREAM LISTENING 15035 /tmp/.ICE-unix/5640
unix 2 [ ACC ] STREAM LISTENING 15091 /tmp/orbit-prithvi/linc-1642-0-1a98eb55b9935
unix 2 [ ACC ] STREAM LISTENING 17548 /tmp/.esd-1000/socket
unix 2 [ ACC ] STREAM LISTENING 17552 /tmp/pulse-prithvi/native
unix 2 [ ACC ] STREAM LISTENING 17592 /tmp/orbit-prithvi/linc-164d-0-5e822c4b810e4
unix 2 [ ACC ] STREAM LISTENING 17713 /tmp/orbit-prithvi/linc-1655-0-1e07139b41ea5
unix 2 [ ACC ] STREAM LISTENING 17794 /tmp/orbit-prithvi/linc-165c-0-63b3cd65ceb73
unix 2 [ ACC ] STREAM LISTENING 18040 /tmp/orbit-prithvi/linc-1665-0-273256a22ab3
unix 2 [ ACC ] STREAM LISTENING 17908 /tmp/orbit-prithvi/linc-1661-0-50b55bb9e0304
unix 2 [ ACC ] STREAM LISTENING 18043 /tmp/orbit-prithvi/linc-1663-0-273256a22ba9
unix 2 [ ACC ] STREAM LISTENING 18292 /tmp/orbit-prithvi/linc-16a8-0-7cb7a2a028aa1
unix 2 [ ACC ] STREAM LISTENING 18562 /tmp/orbit-prithvi/linc-16b1-0-7873e9544607b
unix 2 [ ACC ] STREAM LISTENING 18918 /tmp/orbit-prithvi/linc-16b4-0-29f5faa2ca757
unix 2 [ ACC ] STREAM LISTENING 18826 /tmp/orbit-prithvi/linc-16b0-0-1d5b7b444fd34
unix 2 [ ACC ] STREAM LISTENING 18976 /tmp/orbit-prithvi/linc-16bc-0-18133ac8d8dd5
unix 2 [ ACC ] STREAM LISTENING 19050 /tmp/orbit-prithvi/linc-16ca-0-359b911cd510b
unix 2 [ ACC ] STREAM LISTENING 13202 @/var/run/hald/dbus-drSSEQRZXC
unix 2 [ ACC ] STREAM LISTENING 31970 /tmp/gedit-svn.root.1962470540
unix 2 [ ACC ] STREAM LISTENING 19851 /tmp/orbit-prithvi/linc-1749-0-351e61daad2b3
unix 2 [ ACC ] STREAM LISTENING 19203 /tmp/orbit-prithvi/linc-16bb-0-4326bd5e265e2
unix 2 [ ACC ] STREAM LISTENING 19216 /tmp/orbit-prithvi/linc-16c3-0-641a57e7315d0
unix 2 [ ACC ] STREAM LISTENING 19383 /tmp/orbit-prithvi/linc-16e2-0-7d0cbc3776392
unix 2 [ ACC ] STREAM LISTENING 19459 /tmp/orbit-prithvi/linc-16e9-0-7d0cbc37e7d26
unix 2 [ ACC ] STREAM LISTENING 19473 /tmp/orbit-prithvi/linc-16e5-0-6f3807d4412a4
unix 2 [ ACC ] STREAM LISTENING 19563 /tmp/orbit-prithvi/linc-16a3-0-6f3807d49cc56
unix 2 [ ACC ] STREAM LISTENING 19629 /tmp/orbit-prithvi/linc-16ec-0-6f3807d4e7ca4
unix 2 [ ACC ] STREAM LISTENING 19754 /tmp/orbit-prithvi/linc-16a5-0-5cd56d24b191f
unix 2 [ ACC ] STREAM LISTENING 19928 /tmp/orbit-prithvi/linc-1756-0-607b753e2166c
unix 2 [ ACC ] STREAM LISTENING 20641 /tmp/orbit-prithvi/linc-1771-0-20fc5dd09d12f
unix 2 [ ACC ] STREAM LISTENING 21241 /tmp/orbit-prithvi/linc-1789-0-203e56ccbda0c
unix 2 [ ACC ] STREAM LISTENING 12867 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 21407 /tmp/orbit-prithvi/linc-17b3-0-7a78d582216fd
unix 2 [ ACC ] STREAM LISTENING 14148 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 13839 @/org/bluez/audio
unix 2 [ ACC ] STREAM LISTENING 12647 /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 13984 /var/run/gdm_socket
unix 2 [ ACC ] STREAM LISTENING 22092 @/org/wrapper/NSPlugins/libflashplayer.so/6067-3
unix 2 [ ACC ] STREAM LISTENING 13782 @/var/run/dbus-iKww5SLJIh
unix 2 [ ACC ] STREAM LISTENING 12989 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 13780 /var/run/sdp
unix 2 [ ACC ] STREAM LISTENING 13038 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 32306 @/tmp/dbus-erkBI5pNUj
unix 2 [ ACC ] STREAM LISTENING 13174 @/var/run/hald/dbus-8YV3djVkhZ


All times are GMT -5. The time now is 05:42 AM.