Page 1 of 2
Monitoring Hosts & Services only when the host is powered ON
Posted: Wed Mar 11, 2015 2:49 pm
by swapnil.kadam
Hello Team,
As we're implemented Nagios XI for our cloud based infrastructure monitoring, where we would not have the hosts always up and running. Hence to avoid false alert notification triggers, how can we configure Nagios XI to monitor services status only when the hosts are powered ON?
Regards,
Swapnil
Re: Monitoring Hosts & Services only when the host is powere
Posted: Wed Mar 11, 2015 2:55 pm
by tmcdonald
Re: Monitoring Hosts & Services only when the host is powere
Posted: Mon Mar 16, 2015 9:23 am
by swapnil.kadam
Hello Team,
I have created a host dependency as mentioned below, however I still see that the host status as CRITICAL and I am receiving notification for the hosts with Down status every 60 minutes.
How can I stop receiving notifications for the host with status down?
I would like to receive notification on status change [eg. Down to Up]?
The services of a host with down status should not be monitored or notified, only when the host status is Up we should receive notification for services and hosts.
define hostdependency {
dependent_host_name D_host_B,D_host_C,D_host_D,D_host_E,D_host_F
host_name Host_A
inherits_parent 0
execution_failure_criteria d,o,p,n,
notification_failure_criteria d,o,p,n,
dependency_period xi_timeperiod_24x7
}
define hostdependency {
dependent_host_name Host_B
host_name Host_A
inherits_parent 1
execution_failure_criteria d,o,p,n,
notification_failure_criteria d,o,p,n,
dependency_period xi_timeperiod_24x7
}
Re: Monitoring Hosts & Services only when the host is powere
Posted: Mon Mar 16, 2015 9:36 am
by jdalrymple
Hi swapnil.kadam
You have 2 problems, the service dependencies solves 1 of them. For the other problem it sounds like you're trying to notify only once and then not have further notifications at a regular interval when a host goes offline. That is as simple as this:
notification_interval: This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you've changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.
Does that help?
Re: Monitoring Hosts & Services only when the host is powere
Posted: Mon Mar 23, 2015 1:41 pm
by swapnil.kadam
I am good with notification_interval '0'
However my problem with monitoring the hosts only when they are turn ON remains, I am looking at a dependency configuration that ignores a status of dependent host.
For example: If host B is dependent on host A, and host A goes down, Nagios should not look for the status of host B.
I have tried using parent/child, but in that case the Availability Summary report shows 'Unreachable' status for the dependent child hosts.
Is there a alternative to monitor the hosts only when they are turned ON, it should also update the reports and graphs accordingly.
Re: Monitoring Hosts & Services only when the host is powere
Posted: Mon Mar 23, 2015 2:00 pm
by lmiltchev
For example: If host B is dependent on host A, and host A goes down, Nagios should not look for the status of host B.
This should be taken care of via the "execution_failure_criteria" directive.
Hostdependency - execution failure criteria
This directive is used to specify the criteria that determine when the dependent host should not be actively checked. If the master host is in one of the failure states we specify, the dependent host will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas):
o = fail on an UP state,
d = fail on a DOWN state,
u = fail on an UNREACHABLE state, and
p = fail on a pending state (e.g. the host has not yet been checked).
If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked (if other conditions allow for it to be).
Example: If you specify u,d in this field, the dependent host will not be actively checked if the master host is in either an UNREACHABLE or DOWN state.
Parameter name: execution_failure_criteria
You will need to remove the "n" though...
Change:
Code: Select all
execution_failure_criteria d,o,p,n,
notification_failure_criteria d,o,p,n
to:
Code: Select all
execution_failure_criteria d,o,p,
notification_failure_criteria d,o,p,
Re: Monitoring Hosts & Services only when the host is powere
Posted: Mon Mar 23, 2015 2:17 pm
by swapnil.kadam
Thanks for a quick response...
Ok, in that case what would be the status of a dependent Host B? when Host A is down state. I am looking from a reporting prospective, as the SLA should not be affected when a group of host are supposed to be in down state for a period of time. Because the hosts are turned on only when needed, and I want a realistic SLA results.
Re: Monitoring Hosts & Services only when the host is powere
Posted: Tue Mar 24, 2015 9:51 am
by lmiltchev
Under the SLA reports you have an option to include/exclude downtime (see the "Advanced Options"):
example01.PNG
Re: Monitoring Hosts & Services only when the host is powere
Posted: Tue Mar 24, 2015 10:54 am
by swapnil.kadam
I think you're getting confused with my requirement, let me elaborate it in details.
We are using Nagios XI in a Cloud Based Environment, where we turn on server instances only when needed.
I have all the server instances configured within Nagios XI for monitoring which looks perfect when I have all the server instances up and running. However when we intentionally turn off the server instances, the status changes to DOWN in Nagios which is affected the dashboards/ reports with critical status results and bring down the SLA.
My questions:
Is there a way to monitor server instances [hosts] only when they are turned on [server instance change to DOWN to UP]???
If I configure host dependencies, what would be the status of of dependent host when the parent is in the DOWN state? Because dependent host should be monitored only then the parent host is in UP state.
How can I get rid of the hosts in down state, which are intended to be in down state [refer the attached screen shots]
Thank you in advance
Re: Monitoring Hosts & Services only when the host is powere
Posted: Tue Mar 24, 2015 4:12 pm
by lmiltchev
This is going to be tricky. Nagios would not know if the host is down because you brought it down (as it was no longer needed), or because of a problem... Or you bring a few hosts up. How nagios will know to start monitoring them?
You will have to probably set up a custom scripting solution. When you hosts go up (when you need them), your custom script could add the configs automatically and run "reconfigure_nagios.sh". Before you bring them down, the script could automatically remove them.
Please, review our documentation on automated host management here:
http://assets.nagios.com/downloads/nagi ... gement.pdf
I haven't tested this scenario and I am not a 100% sure if it is going to work but you can give it a try. Hope this helps.