Page 2 of 2
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 8:48 am
by scottwilkerson
Can you show the definition for your check_snmp command?
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 9:18 am
by Ulfandu
Here it is. I believe I haven't touched it at all.
Code: Select all
define command {
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 10:13 am
by scottwilkerson
Looking back, you ran it from the CLI with -C firmasnmp but in your command you have -C testsnmp
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 10:24 am
by Ulfandu
Yeah, I did because I have no such SNMP community called "testsnmp" - that's just a placeholder to not reveal my company's name. So I forgot to edit that line because I didn't want to reveal the company's name where I work - oh well.
EDIT: replaced that to "testsnmp" in the previous post.
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 11:52 am
by scottwilkerson
The only other thing I can think that could be the problem is if 10.2.1.35 isn't really the address specified for the host net-sw-6
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 12:05 pm
by Ulfandu
That's what I thought at first. Here's some images to assure you that the address is in fact correct.
Ubiquiti's login page at 10.2.1.35:
Ubiquiti's other checks in Nagios:
And here's the SNMP community settings for the switch:
Here is the image album in case the formatting gets messed up:
https://imgur.com/a/CHD6Z5V
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 12:58 pm
by scottwilkerson
But what is set in the address field in the Nagios configuration file for the host net-sw-6?
Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 1:28 pm
by Ulfandu
Now I feel like an idiot... The IP address was incorrect all along. I thought I had already checked it, and I most likely had, but for some reason I didn't notice the typo:
Code: Select all
define host {
use generic-switch
host_name net-sw-6
alias Ubiquiti EdgeSwitch ES-16-XG - Upstairs
address 10.2.1.25
hostgroups switches
icon_image ubiquiti.png
}
I've now corrected it to 10.2.1.35 and the checks are working:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails
Posted: Fri Apr 12, 2019 1:38 pm
by scottwilkerson
Ulfandu wrote:Now I feel like an idiot... The IP address was incorrect all along. I thought I had already checked it, and I most likely had, but for some reason I didn't notice the typo:
Code: Select all
define host {
use generic-switch
host_name net-sw-6
alias Ubiquiti EdgeSwitch ES-16-XG - Upstairs
address 10.2.1.25
hostgroups switches
icon_image ubiquiti.png
}
I've now corrected it to 10.2.1.35 and the checks are working:

glad to hear it is resolved!!!
Locking thread