Timeout while trying to query a SNMP server
6,491
The problem was that the community name was wrong, it should be public
instead of comname
.
I run the snmp configuration to set the community name as comname
, but it is still 'public'. I do not know why.
Related videos on Youtube
Author by
Dan
Updated on September 18, 2022Comments
-
Dan over 1 year
I am trying to perform a query to a snmp server but I always obtain a timeout error. I am working with SLES 11 (OpenSUSE) and the firewall is disabled.
The query I am executin is:
> snmpwalk -mALL -v1 -ccomname localhost system 2 > /dev/null Timeout: No Response from localhost
I have tried to allow the access to/from snmp by configuring the files
hosts.allow
and/etc/snmp/snmpd.conf
. These files are below:hosts.allow
snmpd : ALL : ALLOW
snmpd.conf
syslocation Server Room syscontact Sysadmin (root@localhost) # These really aren't meant for production use. They include all MIBS # and can use considerable resources. See snmpd.conf(5) for information # on setting up groups and limiting MIBS. rocommunity public 127.0.0.1 # rwcommunity mysecret 127.0.0.1
netstat
In addition, I have test that the server is actually listening with
netstat
:> sudo netstat -tualpn | grep snmp tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 20561/snmpd udp 0 0 0.0.0.0:161 0.0.0.0:* 20561/snmpd
log file
In addition, I have inspected the log file:
NET-SNMP version 5.4.2.1 Connection from UDP: [127.0.0.1]:47705->[127.0.0.1] Connection from UDP: [127.0.0.1]:47705->[127.0.0.1] [...] Connection from UDP: [127.0.0.1]:39362->[127.0.0.1] Connection from UDP: [127.0.0.1]:39362->[127.0.0.1] Connection from UDP: [127.0.0.1]:39362->[127.0.0.1] Connection from UDP: [127.0.0.1]:39362->[127.0.0.1]
I have observed that every time I execute the
snmpwalk
sentence, 6 entries similar to the above are added to the log.