Template inheritance issue?
Template inheritance issue?
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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Template inheritance issue?
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?
Your knowledge is wrong! LOLslansing 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."
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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Template inheritance issue?
Can you show us the service and the template definitions? Hide sensitive info.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Template inheritance issue?
these good enough?
if you want the text config files I can post those as well
if you want the text config files I can post those as well
You do not have the required permissions to view the files attached to this post.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Template inheritance issue?
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
}
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
}
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Template inheritance issue?
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
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
}
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Template inheritance issue?
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