Unregister a service definition
Andreas Ericsson
ae at op5.se
Thu Jun 17 12:31:02 CEST 2010
On 06/17/2010 09:17 AM, Matthew Angelo wrote:
> Hi Nagios Users,
>
> I have an *extremely* modular configuration. My template structure is well
> defined and when it comes to monitoring a host, it's as simple as including
> it as a Member of a Hostgroup.
>
> An example Linux server would be:
>
>
> # cat ./linux/LINUXSERVER.cfg
> define host{
> use PROD-SERVERS
> host_name LINUXSERVER.local.lan
> alias LINUXSERVER.local.lan
> address LINUXSERVER.local.lan
> hostgroups LINUX, HTTP, SMTP
> }
>
>
> And that's it. It auto inherits all service checks defined against LINUX,
> HTTP and SMTP.
>
> 95% of my LINUX servers have a "/apps" mount point. Therefore it makes
> sense to include a service check for it inside the LINUX host group and then
> inside the Host Definition for the remaining 5% 'unregister' that service
> check.
>
> Is it possible, inside LINUXSERVER2.cfg, to say "Yes I know I'm a member of
> hostgroup LINUX, but I *don't* want to inherit the service check "Disk
> /apps"?
>
> I tried:
>
> define service{
> use GENERIC-SERVICE-TEMPLATE
> host_name LINUXSERVER2.local.lan
> service_description Disk /apps
> check_command null
> }
>
> But obviously this fails with an "Already defined" error.
>
This is patched in the 'dev' branch of git://git.op5.org/nagios.git
which you will have to build from source. 'null' still has to be a
valid check-command, but with the sources in that branch you should
be able to override a service-check inherited from hostgroups.
It's not very tested, but feel free to try it out.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list