check-host-alive -- assistance

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
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

check-host-alive -- assistance

Post by donnyforbes »

I have added the following code to my commands.cfg file...

Code: Select all

#check-host-alive

define command{
command_name check-host-alive
command_line  $USER1$/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}
Then I created a file config file called services.cfg and added the following below.

Code: Select all

define service{
use generic-service
host_name huey
service_description CPU Load
check_command check_nrpe!check_load
check_command check-host-alive
}
however when trying to restart the nagios I am getting the following error. If I take the new added line of code out it starts fine.
Please advise. I am trying to setup nagios to ping my servers. What I am trying to get done overall is when a server is down then get notified.

tail -f /var/log/messages and got this .
Jun 27 08:30:27 nag nagios: Error: Could not add object property in file '/usr/local/nagios/etc/objects/commands.cfg' on line 345.
Jun 27 08:30:27 nag nagios: Error: Invalid max_check_attempts value for host 'duey'
Jun 27 08:30:27 nag nagios: Error: Could not register host (config file '/usr/local/nagios/etc/objects/commands.cfg', starting on line 56)
Jun 27 08:30:27 nag nagios: Error processing object config files!
Jun 27 08:30:27 nag nagios: ***> One or more problems was encountered while processing the config files...
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check-host-alive -- assistance

Post by dwhitfield »

donnyforbes wrote: Jun 27 08:30:27 nag nagios: Error: Invalid max_check_attempts value for host 'duey'
If you take a look at https://assets.nagios.com/downloads/nag ... tions.html, you'll see that max_check_attempts is a required for a host. You need to give us the *host* definition for *duey*. You appear to have given us a *service* definition associated with *huey*.
Locked