Page 1 of 2

Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 1:39 pm
by hudbaylicensing
Is there a way to assign a Service template to service checks already created?

Everytime we need to change password for our WMI checks, we have to go through each and every service and update it there - only recently read about service templates and have created WMI Service Template for each of the AD domains that we have (currently have 3 AD domains companywide) but I am unsure how to apply these to service checks we have already created.

Thanks,
Marc

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 1:44 pm
by slansing
All you need to do is assign that template to your services, make sure that what you want to be inherited from the template is not already defined on the target object itself or it will ignore the template for that option.

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:03 pm
by hudbaylicensing
Thanks for the info - how exactly would I assign it to my existing service checks? Maybe I am doing it wrong:

1. Go to CCM
2. Services in the Monitoring section
3. Find my services that I want to assign the template to and click on it (for example a C: Drive Usage check)
4. Click on Manage Templates button.\
5. Find the new Template I created, select it and click Add Selected.
6. Then remove the original template that was applied.
7. Click Close
8. Remove values in $ARG1$ and $ARG2$.
9. Click Save, then Apply Configuration.

I do not receive any errors, but it doesn't seem to apply the template to it and now just acts as if a username and password has not been specified.

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:05 pm
by tmcdonald
Is the password defined in the template? If not then it would need to be set individually for each service.

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:13 pm
by hudbaylicensing
Yes, it is defined in the template.

One thing, this is a WMI disk space check, it still has $ARG3$ and $ARG4$ values on the service check (critical and warnings). Should I move these args to template as well?

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:37 pm
by lmiltchev
Can you post the service, template, and command definitions? (hide sensitive info)

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:40 pm
by hudbaylicensing
Is there a way to export the definitions? Not sure how...

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 2:46 pm
by hudbaylicensing
Service Template:

define service {
name xiwizard_windowswmi_service_Hudbay
service_description Hudbay WMI Service Disk Usage Checks
use xiwizard_windowswmi_service_Hudbay
check_command check_xi_service_wmiplus!MyAD2\Administrator!MyPassword!!!!!!
register 0

}

Service:

define service {
host_name hbffc130.hudbay.corp
service_description Drive C: Disk Usage
use xiwizard_windowswmi_service_Hudbay
check_command check_xi_service_wmiplus!!!checkdrivesize!-a 'C': -w '80' -c '95'!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contact_groups IT infrastructure Team
_xiwizard windowswmi
register 1

Command:

define command {
command_name check_xi_service_wmiplus
command_line $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
}

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Tue May 13, 2014 5:13 pm
by lmiltchev
Try:

Service Template:

Code: Select all

define service {
name xiwizard_windowswmi_service_Hudbay
service_description Hudbay WMI Service Disk Usage Checks
use xiwizard_windowswmi_service_Hudbay
check_command check_xi_service_wmiplus!'username'!'password'!checkdrivesize!-a 'C': -w '80' -c '90'
register 0
}
Service:

Code: Select all

define service {
host_name hbffc130.hudbay.corp
service_description Drive C: Disk Usage
use xiwizard_windowswmi_service_Hudbay
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contact_groups IT infrastructure Team
_xiwizard windowswmi
register 1
}
Command:

Code: Select all

define command {
command_name check_xi_service_wmiplus
command_line $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
}

Re: Assign Service Templates to Pre-Existing Service Checks

Posted: Wed May 14, 2014 9:33 am
by hudbaylicensing
That worked! Thanks so much!