Page 1 of 1
What is the purpose of the tploptions columns?
Posted: Sun Apr 08, 2018 11:24 am
by toneill2000
I have noticed there are many column that are suffixed with tploptions. For example, if you look at tbl_service you will see a column called host_name_tploptions. It's a tinyint column and it's always populated with integer 2. What is this for and will it ever be a different value than 2? Thanks.
Todd
Re: What is the purpose of the tploptions columns?
Posted: Mon Apr 09, 2018 11:04 am
by lmiltchev
The tploptions columns are related to the null, additive, and standard inheritance. I am not 100% certain about this, but I believe that the values could be: 0 (null), 1 (+), and 2 (standard). If needed, this could be easily tested/verified.
Thank you!
Re: What is the purpose of the tploptions columns?
Posted: Mon Apr 09, 2018 11:53 am
by toneill2000
Hi
@lmiltchev,
We have hosts and services that have no inheritance and some inheritance. The value is still 2 for all of them. I'd like to find a way to verify the changes in this column. Do you have a specific scenario where I can actually see the value change to a 0 or a 1? Mine are all twos. Thanks.
Todd
Re: What is the purpose of the tploptions columns?
Posted: Mon Apr 09, 2018 1:10 pm
by scottwilkerson
Create a service Template,
in it click Manage Hosts
Click Null bottom left
close
Save
This will trigger a host_name_tploptions with a value of 0
Re: What is the purpose of the tploptions columns?
Posted: Tue Apr 24, 2018 5:50 pm
by toneill2000
@lmiltchev and
@scottwilkerson,
You both were correct, thank you.
@scottwilkerson, the example scenario you gave solidified it. Just as you indicated, the values changed in the DB after I changed these settings. These three options (+, null, and standard) are available on most or all the object management screens. Thanks much.
Can someone provide a link to the Nagios documentation for the three options for inheritance discussed in this thread? The
standard inheritance documentation does NOT cover this well enough. I see the sections about "null" which means inheritance won't happen. Standard just means standard inheritance as the documentation describes. And finally, additive which means Nagios literally will use the both the parent attributes AND the object attributes together. Is that all there is to this?
I've done some basic testing and I see te "NULL" and then the + symbol added to the config files like I thought they should work. If that's all there is to it, this post can be closed.
See the image below on exactly the three options that I would like to have documentation resource for if one exists beyond the one I cited above. thanks.
Todd
2018-04-24_18-00-26.jpg
Re: What is the purpose of the tploptions columns?
Posted: Wed Apr 25, 2018 8:48 am
by scottwilkerson
That is all there is, also, if you search that doc for the plus sign (+) you will find this section which describes it's use
Additive Inheritance of String Values
Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.
This "additive inheritance" can be accomplished by prepending the local variable value with a plus sign (+). This features is only available for standard (non-custom) variables that contain string values.
and for null
Cancelling Inheritance of String Values
In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" (without quotes) as the value of the variable that you do not want to inherit.
I am locking this thread as requested.