snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post by scottwilkerson »

Can you show the definition for your check_snmp command?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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$
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post by scottwilkerson »

Looking back, you ran it from the CLI with -C firmasnmp but in your command you have -C testsnmp
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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:

Image

Ubiquiti's other checks in Nagios:

Image

And here's the SNMP community settings for the switch:

Image

Here is the image album in case the formatting gets messed up:
https://imgur.com/a/CHD6Z5V
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post by scottwilkerson »

But what is set in the address field in the Nagios configuration file for the host net-sw-6?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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:

Image
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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:

Image
glad to hear it is resolved!!!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked