check_ping

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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_ping

Post by tgriep »

The command
check_command check_nrpe!check_load
Check the load of a remote server using the check_nrpe plugin to run the command on a remote server that is running the NRPE Agent.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

I made did the following..

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
}

Code: Select all

define service{
use generic-service
host_name huey
service_description CPU Load
check_command check-host-alive
}
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...

Why is it complaining about duey if I made the change to huey? Please advise.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_ping

Post by tgriep »

Check those settings for the other host and verify that they are correct and exist.
Make sure you did not edit the template that host uses or deleted too many lines from the config file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

The command
check_command check_nrpe!check_load
Check the load of a remote server using the check_nrpe plugin to run the command on a remote server that is running the NRPE Agent
Then I would want to use this, however what your saying is I can't use another check_command for icmp if I am using this. That doesn't make since
unless I am missing something.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

Check those settings for the other host and verify that they are correct and exist.
Make sure you did not edit the template that host uses or deleted too many lines from the config file.
here is what I see in this commands.cfg file

Code: Select all

[root@nag objects]# cat commands.cfg | grep max_check_attempts
max_check_attempts 10
not sure why it's complaining about that .. Where else could I look?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_ping

Post by tgriep »

You would create a separate service check for that host with the different command defined, that is how you would use a different command for the same host.
A lot of your questions can be answered by going through the Nagios Table of Contents.
https://assets.nagios.com/downloads/nag ... n/toc.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

This has been good help and all, but I do have a question. If purchasing the XI product is the support better? I just want to make sure what we are going to be spending is worth it. This has been very complicated and I know for a fact i will need support since I HAVE NEVER used this product before.. Really all we need this system to do is send us notification for certain things and then call cell phone when system goes down and is not pingable. I feel this should not be that difficult but maybe I am wrong. TO be honest with you I can''t even get a simple ping command to work correct which is very strange. Anyhow just letting you know how I feel about all this.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

You would create a separate service check for that host with the different command defined, that is how you would use a different command for the same host.
A lot of your questions can be answered by going through the Nagios Table of Contents.
https://assets.nagios.com/downloads/nag ... n/toc.html
Where would I do this on the nagios server? and how would I got about doing this? DO I add something in the commands.cfg file?
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

I have been reading that link you sent me and i notice in the following;

Code: Select all

[root@nag objects]# pwd
/usr/local/nagios/etc/objects
[root@nag objects]# ls
commands.cfg  contacts.cfg  localhost.cfg  printer.cfg  switch.cfg  templates.cfg  timeperiods.cfg  windows.cfg
These are config file correct? The windows.cfg is where I have all my windows hosts added there, the contacts.cfg is where I should put my contact like the one you sent me the other day correct.
The commands.cfg is where all the commands go and the hosts checks etc. is that right? Just trying to get a grasp on this.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: check_ping

Post by donnyforbes »

Can you show me an example of what the commands.cfg, hosts, services config files should look like?
Locked