Page 1 of 1

Hosts without a Service

Posted: Fri Nov 13, 2015 3:59 pm
by joe1871
I am trying to remember the rule here and I hope someone can refresh my memory. It has been years since I built our Nagios implementation. It is Nagios 4 Debian and running the current plugins.

My question surrounds the need for creating a service associated with each (or all) host entries created. If I create a host entry alone, nothing would appear in the web interface for that host. I believe it is necessary to create a wildcard service that is automatically assigned to each host to have the host register in Nagios and have its record appear in the Web interface. To that end a while ago I created a "pingall.cfg" object file that uses a wildcard in the host name field to ping every entry. This has always served us well, but now I have a problem. We have a set of machines in international sites that we monitor across a long distance pipe. The ping times exceed our local settings by a great degree. I need to accommodate the long ping times for these special hosts, but now I have the wildcard getting in the way. I can't take it away, I have more than 750 hosts using it as their primary service. I can't make a list of hosts and add it to the ping command, it is 750 entries long and I don't have one, regardless.

Can you think of any way around this? I was thinking of simply creating a second implementation of Nagios for those international machines. That might be my best bet.

How do you folks get around the need for a service for each host? Do you create one globally as I did, or do you build one in each cfg file explicitly? I'd appreciate knowing.

Thanks

JB

Re: Hosts without a Service

Posted: Fri Nov 13, 2015 5:17 pm
by jrdalrymple
joe1871 wrote:If I create a host entry alone, nothing would appear in the web interface for that host.
Not sure where you got that information - it's simply not true. Each host has its own check_command which could be check_ping, check_dummy, check_http, whatever. There is no need for a service.

Re: Hosts without a Service

Posted: Mon Nov 16, 2015 1:01 am
by Box293
You could create a hostgroup of international hosts. Then to your existing service define the hostgroup with a ! which will exclude these hosts.

Now create another ping service that is assigned to the hostgroup of international hosts with different thresholds.

https://assets.nagios.com/downloads/nag ... ricks.html
Excluding Hosts:
If you want to create identical services on numerous hosts or hostgroups, but would like to exclude some hosts from the definition, this can be accomplished by preceding the host or hostgroup with a ! symbol.

Code: Select all

define service{
		host_name             HOST1,HOST2,!HOST3,!HOST4,...,HOSTN
		hostgroup_name                HOSTGROUP1,HOSTGROUP2,!HOSTGROUP3,!HOSTGROUP4,...,HOSTGROUPN
		service_description   SOMESERVICE
		other service directives ...
		}

Re: Hosts without a Service and Quick Search

Posted: Thu Dec 03, 2015 4:12 pm
by joe1871
Is there a way to get Nagios to display a Host's page from the quick search function on the web mui? These are hosts without any service associated. I have many of them where all we want is the primary "ping" of the host alone as performed by the "check_keep_alive" host check. Our admins are very used to searching using the quick search box and having the properties come up for that host because I created a wildcard ping all command file in my last implementation. I am trying not to do that in my new build, but I also want to meet he expectations of all the admins who use the Nagios web interface.

I would really appreciate anyone who understands this a bit better than I do helping me clarify what has always been a source of confusion with Nagios. Thanks

Joe

Re: Hosts without a Service

Posted: Thu Dec 03, 2015 6:02 pm
by rkennedy
At the time, there is not. I spoke with the developers about it, and added this in as a feature request.

Feel free to add any information to my request @ https://github.com/NagiosEnterprises/na ... /issues/96

As a feature request has been submitted, do you mind if I close out this thread?

Re: Hosts without a Service

Posted: Thu Dec 03, 2015 7:29 pm
by joe1871
No problem - thanks for letting me know.

JB

Re: Hosts without a Service

Posted: Fri Dec 04, 2015 9:55 am
by rkennedy
You're welcome. I will now close this thread out, if you ever need any assistance in the future feel free to create a new one!