I have been searching this forum for quite some time now and can’t seem to find an answer to this burning question i have for ages now.
Is it possible for Nagios to check its own internet connection (for example by pinging google/yahoo) before checking remote servers?
My home internet-connection sadly isn’t very stable (often goes down at night for like a minute).
Which can cause a lot of false alerts.
To me it seems like this basic feature, which i just can’t seem to find any information on (could be me though).
Is there some sort of plugin for this?
Thanks in advance for any advice anyone can give me.
Thanks Geoffrey, this is exactly what i’m looking for!
So you recon that it is ok to configure an external host (like google.com) as a parant of one of my own remote servers?
Even though it really ain’t a parent?
Actually, you should have your HOME nagios setup like you would in any other setup. Your nagios box host just isn’t magically connected to internet. It has an interface card, and hub/switch/router/ and that connects to net. So, create a host name “nagios-eth0”. It has no parent. The host switch/router port, if it’s manageable via IP, will be a host. It’s parent will be the nagios-eth0 ethernet card. The “internet” host can be “google” with a service check of “ping”. It’s parent will be the switch/router/ port. Then, you can have all of your “other hosts” that are remote and on the internet have there parent being the “google” host.
What will happen is this. Nagios will schedule services checks in no particualar order. If let’s say some service check for remote hostA fails, it will then run the host check for that service. Of course, that host check will fail. It will then look at the parent defined, and run the host check for that host. At that point, nagios will not waste time running running the same service check that originally failed, since it now knows, it MUST run the parent checks succesfully first.