Template befor Definition

Mark Eisenblaetter mark.eisenblaetter at gmail.com
Fri Jan 25 10:02:56 CET 2008


On Jan 25, 2008 12:06 AM, Andreas Ericsson <ae at op5.se> wrote:

> Mark Eisenblaetter wrote:
> > On Jan 16, 2008 10:38 AM, Mark Eisenblaetter <
> mark.eisenblaetter at gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> On Jan 16, 2008 10:07 AM, Andreas Ericsson <ae at op5.se> wrote:
> >>
> >>> Please don't top-post. It makes it hard to follow the discussion,
> >>> especially when you're top-posting to an answer that wasn't top-
> >>> posted. Anyways...
> >>>
> >>> Mark Eisenblaetter wrote:
> >>>> Hi,
> >>>> sorry for the latye replay,
> >>>>
> >>>> Then I will have to much templates, because i will need for every
> >>>> kombination of args a new template.
> >>>>
> >>>> For example by check_http I will need a template vor every
> >>> website/service i
> >>>> want to check or for every disk with diffrend warning and Critival
> >>>> threshosld.
> >>>>
> >>>> Thats not so practicable.
> >>>>
> >>> Originally you wrote:
> >>>>>> so it would be great if i can say in the template use the
> >>> check_command
> >>>>>> (check_dummy) defined in the template and not that defined in the
> >>> Host.
> >>> To which I replied:
> >>>>> That's what not setting anything in the object itself is for. If you
> >>> don't
> >>>>> have a check_command in the host object, it will use the one from
> the
> >>>>> template.
> >>>>>
> >>> In other words, if you want a particular object to inherit the value
> >>> from
> >>> the template, simply don't set that value in the object. There was no
> >>> other question-like statement in your original mail.
> >>>
> >> Ok, then my first mail was not so clear I hoped.
> >>
> >> I was thinking of that as a new feature, to minimize the templatework.
> >>
> >>
> > Ok it seems that i am the only one that would like this feature.
> >
> > Or do i miss one way to handle that situation without having a template
> for
> > nearly every check?
> >
>
> You still have not clarified your original email. Only discovered that
> it's
> not clear enough. If you can manage that, I'm sure there's already a
> solution
> in Nagios for you.
>
> --
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Tel: +46 8-230225                  Fax: +46 8-230231
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>

Hi Andreas,

i know that if i don't define an command in the f.e. service definition that
nagios will use the on in the template.

I started to generate a service definition und two templates one for the
master and one for the slave.

Here are an exaple:

define service{
        use
freschness-20min,GL-Tcoder-Active-Service,pnp
        host_name                       gl-tcoder-sw
        servicegroups                   interface
        service_description             Port1
         check_command                    check_mb_snmp_int!1
        }

Master Template, template pnp and freschness is only to set the
checkfreschness and extinfo on the Master server and on the slave they are
empty

define service{
    register                        0
    name                            GL-Tcoder-Active-Service
    active_checks_enabled           0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    passive_checks_enabled          1
    obsess_over_service             0
    check_freshness                 0
    event_handler_enabled           0
    notifications_enabled           1
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r,f
    contact_groups                  rss,streaming
}

Slave Template

define service{
    register                        0
    name                            GL-Tcoder-Active-Service
    active_checks_enabled           1
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    passive_checks_enabled          0
    obsess_over_service             1
    check_freshness                 0
    event_handler_enabled           0
    notifications_enabled           0
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r,f
    contact_groups                  rss,streaming,bereitschaft
}


you can see that i am only change the definition from active on the slave to
passiv an the master. With the problme on the master if he is trying to
check freschness that he will try the interface check.

If i want to use the check_dummy an the main server i have to move thec
checkcommand in the templet definition. So that i can define on the slave
template the snmpcheck and on the master template the check_dummy.

wenn i will do it that way i have to generate for every interface i want to
check one template. I think in my case it would be nearly 150 templates for
diffrent plugins and args.

my intention is now to write it taht way but in the master template i will
define an checkcommand with check_dummy so that i don't need the additional
templates.

in addition i want to try to have a minimum of definition that are uniq on
the slaves. In my setup it only the templates ans host- and service- groups
the rest i kan use 1to1 from the Master and it will be easier to sync the
config.

In the meentime i will try to go throuh the source code and look if i'm
able  to  make a patch for this behavior but my C is a lot worther then my
english.

I hope this helps because i don't know ta way o describe it better.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20080125/cdca0102/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list