Page 1 of 2

Template inheritance issue?

Posted: Wed Oct 09, 2013 1:00 pm
by BanditBBS
If I set the ARG3 of a service to something, if I assign a template that has ARG1, 2 and 3 set, should the template's ARG3 override the service's configured ARG3? I thought if it was defined in the service that it took precedence over the template.

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:04 pm
by slansing
The service's configuration definitions will always precede the templates, if something is not defined in the service config but it is in the template this will be transposed on the service config. So if you have ARG3 defined in a service already, the template's definition will not be used. "To my knowledge."

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:08 pm
by BanditBBS
slansing wrote:The service's configuration definitions will always precede the templates, if something is not defined in the service config but it is in the template this will be transposed on the service config. So if you have ARG3 defined in a service already, the template's definition will not be used. "To my knowledge."
Your knowledge is wrong! LOL

Seriously though, I found a case where it is not true. I actually found a case where all sort of weird things happen.

Almost nothing configured in service, no command no ARGs. The template has everything configured in it. If I supply the service def with ARG3 it doesn't take effect. If I set the command in the service and leave ARG1 and ARG2 empty, my check then fails as it isn't grabbing ARg1 and 2 from the template. very strange behavior.

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:21 pm
by tmcdonald
Wanna post/PM some configs?

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:24 pm
by lmiltchev
Can you show us the service and the template definitions? Hide sensitive info.

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:25 pm
by BanditBBS
these good enough?
Capture1.JPG
Capture2.JPG
if you want the text config files I can post those as well

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:28 pm
by tmcdonald
Texts would probably be a bit more complete.

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:30 pm
by BanditBBS

Code: Select all

define service {
       name                                     win_prod_drive_c
       service_description                      Drive C: Disk Usage
       use                                      xiwizard_windowswmi_service
       check_command                            check_xi_service_wmiplus_auth!-A $USER1$/wmiauth.cfg!checkdrivesize!-a 'C': -w '90' -c '95'!!!!!
       max_check_attempts                       2
       check_interval                           5
       retry_interval                           2
       check_period                             24x7
       notification_interval                    15
       notification_period                      xi_timeperiod_24x7
       notification_options                     w,c,r,
       notifications_enabled                    1
       register                                 0

}
and

Code: Select all

define service {
        host_name                       WDCAE-PWEB04P.AEO.AE.COM
        service_description             Drive E: Disk Usage
        use                             win_prod_drive_c
        contact_groups                  cust_systems_devs
        _xiwizard                       windowswmi
        register                        1
        }
I think I found the issue!!!! ARG3 isnt written to file if ARG1 and 2 are empty?

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 1:34 pm
by BanditBBS
Hmmmm, it has to be with how the command is written to file. Because no command is set it doesn't write the ARGs. But if I set the command, ARG1 and ARG2 are not passed to the service definition.

This is what it looks like with command set and only ARG3

Code: Select all

define service {
        host_name                       WDCAE-PWEB03P.AEO.AE.COM
        service_description             Drive E: Disk Usage
        use                             win_prod_drive_c
        check_command                   check_xi_service_wmiplus_auth!!!-a 'E': -w '90' -c '95'!!!!!
        contact_groups                  cust_systems_devs
        _xiwizard                       windowswmi
        register                        1
        }

Re: Template inheritance issue?

Posted: Wed Oct 09, 2013 4:50 pm
by slansing
Whelp, color me wrong on this one though logically it should work as everything else normally does when inheriting from a template. You cannot currently pass arguments through the template. At least I can't on 2.4