SNMP Checks unable to query host error

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.
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

SNMP Checks unable to query host error

Post by mtripodi »

Hi there,

Version: Nagios Core 4.4.5
OS: CentOS 7

I am attempting to apply SNMP monitoring checks for our QNAP NAS device. I have a storage check utilizing a script which points to the information on our QNAP device (see screenshot). I downloaded the MIB file from QNAP, renamed to QNAP-MIB.txt and copied to directory /user/share/snmp/mibs. I updated the community key and trap IP address (IP of Nagios server). However, I continue to receive a Warning error: CRITICAL : Unable to SNMP query $HOST. Please see screenshots for further information. I can provide a copy or excerpt of the script we are using if that helps diagnose the issue. Thanks!
Attachments
script.png
nagios.png
nagios qnap.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Checks unable to query host error

Post by scottwilkerson »

From your Nagios server if you run the following do you get a response?

Code: Select all

snmpwalk -v 2c -c 'w2ghi_fte_' -m /usr/share/snmp/mibs/QNAP-MIB.txt ph-qnap-001 NAS-MIB::SysVolumeFreeSize.1
If not how about a generic walk?

Code: Select all

snmpwalk -v 2c -c 'w2ghi_fte_' ph-qnap-001
Last edited by scottwilkerson on Fri Sep 27, 2019 10:42 am, edited 1 time in total.
Reason: edited command
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: SNMP Checks unable to query host error

Post by mtripodi »

No results
Attachments
command result.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Checks unable to query host error

Post by scottwilkerson »

Ok, your system doesn't know how to resolve the host ph-qnap-001 that's the problem
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: SNMP Checks unable to query host error

Post by mtripodi »

Ok if that's the case, where should I be looking to resolve? In the Nagios script, configuration, QNAP configuration?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Checks unable to query host error

Post by scottwilkerson »

mtripodi wrote:Ok if that's the case, where should I be looking to resolve? In the Nagios script, configuration, QNAP configuration?
Either your DNS administrator or on the Nagios XI system you could add the IP/host to /etc/hosts

example

Code: Select all

192.168.18.235 ph-qnap-001
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: SNMP Checks unable to query host error

Post by mtripodi »

The host config is there for the QNAP. I'm using Nagios Core on CentOS 7 so it's located here: /user/local/nagios/etc/objects/hosts/

All service checks are working except for this one. So i'm thinking the script/command is not able to see the host.
Attachments
services.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Checks unable to query host error

Post by scottwilkerson »

The script you have had this line

Code: Select all

HOST='ph-qnap-001'
I would suggest changing it to something your server can resolve such as possibly

Code: Select all

HOST='ph-qnap-001.kobo.corp'
or the IP of the server

Code: Select all

HOST='xxx.xxx.xxx.xxx'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: SNMP Checks unable to query host error

Post by mtripodi »

i did that to no effect. Further suggestions?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Checks unable to query host error

Post by scottwilkerson »

can you ping ph-qnap-001.kobo.corp from the Nagios Server?

Code: Select all

ping ph-qnap-001.kobo.corp
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked