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:
snmpd : ALL : ALLOW
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
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
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.
كانت المشكلة أن اسم المجتمع كان خاطئًا ، يجب أن يكون عام
بدلاً من اسم com
.
قمت بتشغيل تكوين snmp لتعيين اسم المجتمع باسم comname
، لكنه لا يزال "عامًا". لا أعرف لماذا.