Template Structure is Better???

Tom DE BLENDE tdeblend at gcc.dhl.com
Tue Jan 14 15:09:13 CET 2003


Hi Pete,

> "Shelfo, Pete" wrote:
> 
> I have been using Netsaint 7.0 for a long time and have built up
> quite a large number of non-standard check_snmp statements that
> require individual configuration per server.  With the new template
> based format for Nagios 1.0 my services.cfg file is going to be huge
> since each service statement is now about 10 lines instead of one
> line condensed.  

I just moved from NetSaint 0.0.7 to Nagios as well. You have a point
that the one line per service was easier to overview. However, don't
let this scare you. Templates are really fun to play with! 

> This is going to make maintenance very difficult
> since I will have to browse tons of pages to find a service.   

Well, you can always use the search funtion in vi...

> I don’t want to go back to the old “default” method since I am
> completely transferring my system into the new format and don’t want
> to be outdated on the offset.

That was one of my motivations as well.> 

> Is there a way to manage custom statements like check_snmp and
> NSClient Windows service check so that they are not out of control?
> I see the benefit for template’s but that seems to be limited to
> environments that all the hosts in a network have similar settings.
> If one server in a group does not follow a guideline then you have
> to expand the group to individual hosts.  Can you do hostgroup
> exemptions in a service check?  Can you issue multiple
> check_commands in one service statement?

See it like this: directives for a specific host or service take
precedence over template settings. And that is a true blessing! One
example:

I monitor a lot of SQL servers, so I have a SQL service template like
this:

# SQL Process definition template
define service{
        name                            SQL
        service_description             SQL
        active_checks_enabled           1
        passive_checks_enabled          1
        parallelize_check               1
        obsess_over_service             1
        check_freshness                 0
        notifications_enabled           1
        event_handler_enabled           1
        flap_detection_enabled          1
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        is_volatile                     0
        max_check_attempts              3
        normal_check_interval           1
        retry_check_interval            1
        contact_groups                  nt-admins
        notification_interval           600
        notification_period             24x7
        check_period                    24x7
        notification_options            u,c,r
        check_command                  
check_nt_service!MSSQLServer,SQLServerAgent

        register                                0
        }

One avarage SQL service definition will look like this:

# Service definition
define service{
        use                             SQL

        host_name                       server1
        }

However, when monitoring a clustered SQL server, I have the following:

# Service definition
define service{
        use                             SQL

        host_name                       cluster1
        check_command                  
check_nt_service!'MSSQLServer$cluster1','SQLServerAgent$cluster1'
        }

So you see I can use everything from the template, and still change
that one directive that does not fit in, in this case the
check_command. 

In my opinion the new template format beats the "Old Way". You just
have to learn the little tricks and not just run the convert tool and
leave it to that. Using that tool is a start that will save you a lot
of typing work, but you should then try to exploit everyting that
templates have to offer.

And as far as the size is concerned... that's about the only setback I
can see and was a bit my concern as well...

Kind regards,
Tom


-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en




More information about the Users mailing list