How to use the "use" statament

Saulo Silva sauloaugustosilva at gmail.com
Tue Jan 9 22:14:27 CET 2007


Hi all ,

I am installed I Nagios in a Suse 10 box And have a question.

How I can use the "use" statement when I am writing a service definition
based in templates .

first idea - Create all services templates  separated and put all in the
service definition that should be monitoring :

the s_default_template.cfg

define service{
        name                            default_service
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        register                        0
        is_volatile                     0
        max_check_attempts              3
        normal_check_interval           45
        retry_check_interval            8
        notification_interval           120
        notification_period             24x7
        notification_options            w,u,c,r
        }

define service{
        name                            Service_Defaults_Active
        active_checks_enabled           1
        passive_checks_enabled          0
        obsess_over_service             1
        check_freshness                 0
        notifications_enabled           0
        flap_detection_enabled          1
        check_period                    24x7
        register                        0
        }

define service{
        name                            Service_Defaults_Passive
        active_checks_enabled           0
        passive_checks_enabled          1
        obsess_over_service             0
        check_freshness                 1
        notifications_enabled           1
        flap_detection_enabled          0
        check_period                    none
        register                        0
        }

the s_cpu_template.cfg ( part of )

define service{
        name                            Service_CPU_Prod_Local
        register                        0
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            1
        check_command                   $USER6$/rcheck_cpu
}

the service itself

define service{
        host_name                       ztux-appserv.pok.ibm.com
        service_description             CPU_check
        use                             Service_Defaults_Passive
        use                             Service_CPU_Prod_Local
        use                             default_service
        contact_groups                  cyoung
       }

And the second one : Use templates cascaded to final service

define service{
        name                            default_service
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        register                        0
        is_volatile                     0
        max_check_attempts              3
        normal_check_interval           45
        retry_check_interval            8
        notification_interval           120
        notification_period             24x7
        notification_options            w,u,c,r
        }


define service{
        name                            Service_Defaults_Passive
        active_checks_enabled           0
        passive_checks_enabled          1
        obsess_over_service             0
        check_freshness                 1
        notifications_enabled           1
        flap_detection_enabled          0
        check_period                    none
        register                        0
        use                             default_service
        }

define service{
        name                            Service_CPU_Prod_Local
        register                        0
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            1
        check_command                   $USER6$/rcheck_cpu
        use           Service_Defaults_Passive
}

define service{
        host_name                       ztux-appserv.pok.ibm.com
        service_description             CPU_check
        use                             Service_CPU_Prod_Local
        contact_groups                  cyoung
       }




So that is the simple question . One of this kind of construction works ? I
test with nagios -v  in version 1.2 ( SUSE 9 ) no error , in nagios 1.3 (
Suse 10 ) I had error . Or should I create just one template for each
different kind of check and copy all other information ?

Best regards,

Saulo Augusto Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070109/0e844056/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
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