SNMP Host Testing : Name or service not known [SOLVED]
I'm trying to configure some SNMP data points but, when I test the data source I get "mango.ayt: mango.ayt: Name or service not known".
I'm pretty sure the SNMP agent is working good. Here is the output from a Linux box:
[root@server ~]# snmpget -v 1 -c public 192.168.68.3 .220.127.116.11.18.104.22.168.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux server.ayt 2.6.18-371.1.2.el5 #1 SMP Tue Oct 22 12:57:43 EDT 2013 i686
And this is the Mango output:
Can someone please let me know if I'm missing something?
It's really hard to say what's going on. Did you try it with the local address field blank and the other snmp versions?
Yes, Joel. I've tried without local IP specification (Mango server has two IP address) and the three snmp versions.
Also, this is the target machine snmpd.conf
com2sec local_host localhost public com2sec local_net 192.168.68.0/27 public #Se asigna local_host al grupo de lectura escritura group MyRWGroup v1 local_host group MyRWGroup v2c local_host group MyRWGroup usm local_host #Se asigna local_net al grupo de solo lectura group MyROGroup v1 local_net group MyROGroup v2c local_net group MyROGroup usm local_net ## name incl/excl subtree mask(optional) view all included .1 80 ## group context sec.model sec.level prefix read write notif access MyROGroup "" any noauth exact all none none access MyRWGroup "" any noauth exact all all all syslocation Servidor AyT (Linux) syscontact Administrador (email@example.com)
I'm not sure, what is the information in the OID that you want to read? I do know that Mango can only read certain types of OID. Some OIDs have multiple sets of data within them which Mango does not handle very well. If you have an OID you can test that hold a single numeric value, this might be the best way to test it. I have used SNMP to pull data from UPS's and other equipment very easily but have experienced some issues with trying to get server stats which I think is related to the issues mentioned. I'm really not an expert in SNMP configuration so unfortunately probably can't help a whole lot.
Ok, I think there is a problem with the Linux server environment :cry: .
I ran the same test from a different Mango instance running on my PC (Windows 7) to the same SNMP Agent (through internet access) and this is the reply:
Thanks a lot, Joel
Ok, I finally got this thing working.
The error message "mango.ayt: mango.ayt: Name or service not known" gave me a clue: the server doesn't recognises its own hostname.
A quick view on /etc/hosts confirmed this idea
[root@mango ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
So I edited this file to make it look like this:
[root@mango ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.68.2 mango mango.ayt ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
And voila!, problem solved. Now SNMP module is working.
This could be valid for anyone trying to get Mango Automation to work on CentOS 6.
Thanks very much for sharing, I'm sure that will be useful to others.