Hi all , <br><br>I am installed I Nagios in a Suse 10 box And have a question. <br><br>How I can use the "use" statement when I am writing a service definition based in templates . <br><br>first idea - Create all services templates separated and put all in the service definition that should be monitoring :
<br><br>the s_default_template.cfg <br><br>define service{<br> name default_service<br> process_perf_data 1<br> retain_status_information 1<br> retain_nonstatus_information 1
<br> register 0<br> is_volatile 0<br> max_check_attempts 3<br> normal_check_interval 45<br> retry_check_interval 8
<br> notification_interval 120<br> notification_period 24x7<br> notification_options w,u,c,r<br> }<br><br>define service{<br> name Service_Defaults_Active
<br> active_checks_enabled 1<br> passive_checks_enabled 0<br> obsess_over_service 1<br> check_freshness 0<br> notifications_enabled 0
<br> flap_detection_enabled 1<br> check_period 24x7<br> register 0<br> }<br><br>define service{<br> name Service_Defaults_Passive
<br> active_checks_enabled 0<br> passive_checks_enabled 1<br> obsess_over_service 0<br> check_freshness 1<br> notifications_enabled 1
<br> flap_detection_enabled 0<br> check_period none<br> register 0<br> }<br><br>the s_cpu_template.cfg ( part of ) <br><br>define service{<br>
name Service_CPU_Prod_Local<br> register 0<br> max_check_attempts 5<br> normal_check_interval 5<br> retry_check_interval 1
<br> check_command $USER6$/rcheck_cpu<br>}<br><br>the service itself <br><br>define service{<br> host_name <a href="http://ztux-appserv.pok.ibm.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
ztux-appserv.pok.ibm.com
</a><br> service_description CPU_check<br> use Service_Defaults_Passive<br> use Service_CPU_Prod_Local<br> use default_service
<br> contact_groups cyoung<br> }<br><br>And the second one : Use templates cascaded to final service<br><br>define service{<br>
name default_service<br>
process_perf_data 1<br>
retain_status_information 1<br>
retain_nonstatus_information 1<br>
register 0<br>
is_volatile 0<br>
max_check_attempts 3<br>
normal_check_interval 45<br>
retry_check_interval 8<br>
notification_interval 120<br>
notification_period 24x7<br>
notification_options w,u,c,r<br>
}<br>
<br><br>define service{<br>
name Service_Defaults_Passive<br>
active_checks_enabled 0<br>
passive_checks_enabled 1<br>
obsess_over_service 0<br>
check_freshness 1<br>
notifications_enabled 1<br>
flap_detection_enabled 0<br>
check_period none<br>
register 0<br>
use default_service<br>
}<br><br>define service{<br>
name Service_CPU_Prod_Local<br>
register 0<br>
max_check_attempts 5<br>
normal_check_interval 5<br>
retry_check_interval 1<br>
check_command $USER6$/rcheck_cpu<br> use Service_Defaults_Passive<br>
}<br><br>define service{<br>
host_name <a href="http://ztux-appserv.pok.ibm.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ztux-appserv.pok.ibm.com</a><br>
service_description CPU_check<br>
use Service_CPU_Prod_Local<br>
contact_groups cyoung<br>
}<br><br><br><br><br>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 ? <br><br>Best regards, <br><br>Saulo Augusto Silva