Page 1 of 1

check in time

Posted: Thu Aug 29, 2019 4:58 am
by crechet51
Hi,

I need to check some hosts only if they are turned on.
If computers are turned off, then they do not need to be checked.

Have any ideas how to realize it?

Re: check in time

Posted: Thu Aug 29, 2019 3:00 pm
by mbellerue
This sounds like a job for service dependencies.

https://assets.nagios.com/downloads/nag ... ncies.html

All of the services for a given host are dependent upon the host check. Don't notify on the host check, if the hosts are expected to be down. Only notify on the services.

This could cause a problem if a host is booting up as a host check occurs. The host check succeeds, so Nagios goes to check the services, and because the host is still booting up, the service checks fail.

Another way to do this would be to install a client, like NCPA, and use passive checks. That way the only time checks execute are when the host is up and able to perform the checks.

https://www.nagios.org/ncpa/

Re: check in time

Posted: Tue Sep 10, 2019 7:02 am
by crechet51
Googled for a long time and tried to make addictions work.

Can you help and give some example of how, I can depending the result of the execution of one command, to execute another command? :|

Re: check in time

Posted: Tue Sep 10, 2019 12:55 pm
by mbellerue
crechet51 wrote:Googled for a long time and tried to make addictions work.

Can you help and give some example of how, I can depending the result of the execution of one command, to execute another command? :|
If you want to execute a command based off of a service check, you would want to look at Event Handlers. Here's a document to get you started.

https://assets.nagios.com/downloads/nag ... ios-XI.pdf