Assign services to hosts, instead of hosts to services

Christian Schneemann cschneemann at suse.de
Wed Jun 4 11:57:43 CEST 2008


On Wednesday June 4 2008 09:26:22 am Tom Sommer wrote:
> Hi,
>
> I have a growing pain with Nagios that I thought I might share with you.
>
> I have a lot (!) of servers, and while some of them are generic and thus
> grouped, I also have a lot of servers to which I need set up custom
> monitoring per host.
>
> This means, correct me if I am wrong, I need to go to each service I want
> to apply to a host, and enter it into the "host_name" variable.
>
> The problem is that the variable becomes so huge, that it becomes
> impossible to maintain effectively.
>
> Therefore, I suggest the opposite. Add a variable to each host (and host
> group), called "services"/"service_group", where you enter a list of
> services you want for that host. This means it becomes extremely easy to
> setup custom monitoring on a per-host basis.
>
> I migrated from a monitoring system that did this, and I miss it terribly.
>
> Thoughts?
Hi,
the solution I have done here at our nagios-system is this:
Every check has its own hostgroup, a definition looks like this:

define hostgroup{
        hostgroup_name          mysql-check
        register                0
        }

define service{
        use                             service-template
        hostgroup_name                  mysql-check
        service_description             MySQL Status
        check_command                   check_mysql
        }

The register 0 hides the group on the webinterface.

Now I add a host with a mysql database simply to this group, that can be done 
per host:

define host{
        use                     hosts-template
        host_name               important-server
        hostgroups              mysql-check
        }

Is this something you're looking for?

Greetings,
	Christian
>
> // Tom Sommer
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-devel



-- 
Christian Schneemann

-------------------------------------
SUSE LINUX Products GmbH,
Maxfeldstr. 5, D - 90409 Nürnberg

Phone:  +49 (0)911 - 740 53 0
e-mail: cschneemann at suse.de
-------------------------------------
SUSE LINUX Products GmbH, GF: Markus Rex
HRB 16746 (AG Nürnberg)

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php




More information about the Developers mailing list