Page 1 of 1

Service correlation

Posted: Mon Dec 16, 2013 5:44 am
by _demo_
Hi

I'm looking for a simple solution to check the availability of my network connection.
What I am trying to do is something like check_http google.com
if google.com is reachable => network connection ok
if google.com is not reachable => network connection down

The Problem is that sometimes google.com itself is down :-(

My solution would be to check
if google.com and yahoo.com (two websites) are not reachable => network connection down
correlation.jpg
How can I manage such kind of correlation in Nagios? I have just found http://nagios.sourceforge.net/docs/nagi ... ncies.html
but I think this is from another perspective of view.

thanks in advance

Re: Service correlation

Posted: Mon Dec 16, 2013 10:40 am
by tmcdonald
I think this might be what you're looking for.

Re: Service correlation

Posted: Tue Dec 17, 2013 6:08 am
by _demo_
Hm, but parents are relationships between physical hosts??
Within hosts.cfg I can only define hosts with a required address Field.
How can I define "My Network" as a host with the Parents Google and Yahoo %-/ (confused)?

Code: Select all

define host{
        use                     basic-host
        host_name               Internet
        alias                   Internet
        address                 ?????????????????????????????
        parents                 Google,Yahoo
        notifications_enabled   1
        check_interval          5
        retry_interval          1
        max_check_attempts      2
        }

define host{
        use                     basic-host
        host_name               Google
        alias                   Google
        address                 google.com
        check_command           check-host-alive
        notifications_enabled   0
        check_interval          5
        retry_interval          1
        max_check_attempts      1
        }

define host{
        use                     basic-host
        host_name               Yahoo
        alias                   Yahoo
        address                 yahoo.com
        check_command           check-host-alive
        notifications_enabled   0
        check_interval          5
        retry_interval          1
        max_check_attempts      1
        }
This dependency topic hosts vs services is really confusing me.

Re: Service correlation

Posted: Tue Dec 17, 2013 12:22 pm
by slansing
You would create hosts for google and yahoo, then assign them as parents to your current hosts with the "parent" configuration directive mentioned in tmcdonald's post.

Re: Service correlation

Posted: Wed Dec 18, 2013 6:31 am
by _demo_
But, I want Nagios to tell me that the Internet is down (because google and yahoo are unreachable)

I do not want Nagios to tells me that Host XY ist down because the Internet is down.

Hence I still think, that parent/child solution is not what I am searching for :-(
Better would be a service on the Nagios Host that probes via something like check_http

Code: Select all

define service{
        service_description     www1
        use                     active_service 
        host_name               www.google.com
        check_command           check_http!/!2!5
        notifications_enabled  0
        }
define service{
        service_description     www2
        use                     active_service 
        host_name               www.yahoo.com
        check_command           check_http!/!2!5
        notifications_enabled   0
        }
But then I have do correlate this checks and I don't konw how to do this with Nagios :?: :oops:
like
if www1 and www2 down then www critical

Re: Service correlation

Posted: Wed Dec 18, 2013 11:42 am
by lmiltchev
You can probably use the BPI - in can be used not only in Nagios XI but also in Nagios Core...

http://assets.nagios.com/downloads/nagi ... _Addon.pdf

You can create a BPI group "Internet" with two members - google and yahoo. If both members are down, then the Internet is down...