Page 1 of 1
Template inheritance question and CCM bug?
Posted: Wed Nov 13, 2013 1:59 pm
by BanditBBS
Two things:
1.) When I modify a service and select the hosts button, any way to make it only inherit hosts from template used if there is no host specified on the service?
2.) When on the hosts screen and I select +, null or standard and hit close then save, if I go back into that service and into hosts, that option is not selected.
Re: Template inheritance question and CCM bug?
Posted: Wed Nov 13, 2013 2:09 pm
by abrist
1) So you want services to apply to hosts that use a certain host template, correct? If not, could you clarify?
2) This is a confirmed bug with the CCM, the workaround is to use the legacy ccm until XI 2014.
Re: Template inheritance question and CCM bug?
Posted: Wed Nov 13, 2013 2:13 pm
by BanditBBS
abrist wrote:1) So you want services to apply to hosts that use a certain host template, correct? If not, could you clarify?
2) This is a confirmed bug with the CCM, the workaround is to use the legacy ccm until XI 2014.
1) Umm, let me explain better. I have a group of services that all use a specific service template. That service template has the hosts that should use it configured in it. There are one or 2 services that also use that service template, but I want to specify the hosts that should get this service on the service itself and ignore what is defined in the service template.
2) bah - LOL
Re: Template inheritance question and CCM bug?
Posted: Thu Nov 14, 2013 11:10 am
by lmiltchev
1.) When I modify a service and select the hosts button, any way to make it only inherit hosts from template used if there is no host specified on the service?
BanditBBS, I believe this should work just fine... I tested this scenario on my test box, and seems to work. I created a "Dummy Service", that is NOT added to a host.
Code: Select all
define service {
service_description Dummy Service
use dummy_service_template
servicegroups linux-servers-all
check_command check_local_load!6.0,5.0,4.0!12.0,10.0,8.0!!!!!!
check_period tracs monitoring times
first_notification_delay 0
notification_options w,c,u,r,f,s,
notifications_enabled 1
contact_groups null
register 1
}
Here's the "dummy_service_template" definition:
Code: Select all
define service {
name dummy_service_template
host_name NCPA
service_description dummy_service_template
is_volatile 0
max_check_attempts 3
check_interval 10
retry_interval 2
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
parallelize_check 1
obsess_over_service 1
check_freshness 0
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 60
notification_period 24x7
notification_options w,c,u,r,
notifications_enabled 1
failure_prediction_enabled 1
register 0
}
When I check the "/usr/local/nagios/var/objects.cache", I can see that "Dummy Service" is "added to" the NCPA host (grabbing it from the template):
Code: Select all
define service {
host_name NCPA
service_description Dummy Service
check_period tracs monitoring times
check_command check_local_load!6.0,5.0,4.0!12.0,10.0,8.0!!!!!!
notification_period 24x7
initial_state o
hourly_value 1
check_interval 10.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 0
parallelize_check 1
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c,f,s
notifications_enabled 1
notification_interval 60.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
}
Re: Template inheritance question and CCM bug?
Posted: Thu Nov 14, 2013 11:18 am
by BanditBBS
Yes, that is how it works.
I have a list of, let's say, 25 services that use that service template and they are all added to the NCPA host. There is one service though, that I'd like to use that service template on so it inherits everything set in the template, EXCEPT the host. On this service, I'd like to specify the host it should go to in the service definition itself. If I do that, it has HOST2 and NCPA as it inherits that from the host. Is there a way to stop that inheriting?
Re: Template inheritance question and CCM bug?
Posted: Thu Nov 14, 2013 1:24 pm
by lmiltchev
To be honest, I am not able to recreate the issue. I just went to the CCM->Service->Dummy Service->Modify->Manage Hosts, and added a "Windows 7" host. When I check the objects.cache, I can see the "new" host (added on a service level), but not the "old one" (from the template).
Code: Select all
define service {
host_name Windows 7
service_description Dummy Service
check_period tracs monitoring times
check_command check_local_load!6.0,5.0,4.0!12.0,10.0,8.0!!!!!!
notification_period 24x7
initial_state o
hourly_value 1
check_interval 10.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 0
parallelize_check 1
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c,f,s
notifications_enabled 1
notification_interval 60.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
Re: Template inheritance question and CCM bug?
Posted: Thu Nov 14, 2013 1:37 pm
by BanditBBS
I worked around it a different way that ended up being better for me anyway. But in the future, if I may run into this again. But I don't care enough to continue investigating why I was having an issue! LOL
Thanks for looking into it though. I'll open a new thread if I have the issue in the future.
Re: Template inheritance question and CCM bug?
Posted: Thu Nov 14, 2013 3:00 pm
by lmiltchev
Fair enough.
