Service check warnings/errors

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.
Locked
timbo
Posts: 6
Joined: Thu Jan 28, 2016 8:01 pm

Service check warnings/errors

Post by timbo »

Hi,

I"m trying to setup Nagios in our environment and have run into a few teething issue with monitoring services on client servers. I've setup the Nagios monitoring server (v4.1.1) fine and followed the instructions http://www.tecmint.com/how-to-add-linux ... ng-server/ to add linux clients. Nagios can tell the server is 'up' but the services are all returning warnings:

'(No output on stdout) stderr: Could not resolve hostname -c: Temporary failure in name resolution'
Sometimes the error for a service may change to '(No output on stdout) stderr: Could not resolve hostname -c: Name or service not known' but will eventually change back to the first error.

As far as I can tell, DNS resolution works fine (I setup entries in our DNS and both hosts can resolve each other). I even added an entry for the remote host in the hosts files of the Nagios monitoring server. Nslookup returns the expected output (forward and reverse)

Any ideas what might be causing this? I thought it might be the hostname format in the hosts.cfg or services.cfg (I used a short hostname in there - I don't have any choice with this because if I put FQDN hostname in there, the Nagios service returns errors and will not start)

The Nagios monitoring server is CentOS7, as is the remote host. They are both virtual servers.

Any ideas about how to troubleshoot this? Any help will be appreciated. I'm sure it's something simple I've overlooked as googling this error hasn't returned many hits.

Cheers,

timbo
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service check warnings/errors

Post by rkennedy »

Can you post the full command you are trying to run (from the service definition), along with the check command definition? It looks like it's trying to resolve -c as your hostname, so something probably isn't lining up properly.
Former Nagios Employee
timbo
Posts: 6
Joined: Thu Jan 28, 2016 8:01 pm

Re: Service check warnings/errors

Post by timbo »

Thanks rkennedy - that was the direction I needed to be pointed in!

It's probably fairly obvious stuff to those familiar with Nagios but it's all new to me.

I had actually thought it was trying to connect to host '-c' but I couldn't figure out wehere that was coming from. In the end it was a simple case of syntax error. I'd used the following command but had left one of the '$' symbols out!:

###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

I feel a little silly but thanks for your help!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service check warnings/errors

Post by rkennedy »

No problem, it's all learning and I'm glad you were able to catch the mistake! :D

Are we good to close this thread, or did you have any more questions related to this?
Former Nagios Employee
timbo
Posts: 6
Joined: Thu Jan 28, 2016 8:01 pm

Re: Service check warnings/errors

Post by timbo »

This can be closed
Locked