Conversation
|
OK, starting to look at this now. Dumping questions as i see them. Is the feature not more appropriately named template variables ? |
okconfig/__init__.py
Outdated
There was a problem hiding this comment.
Please move this import to the top of the file.
Also, please put yaml dependency in requirements.txt, rpm spec file and debian/ directory
|
Ok i didnt run this yet, but the code diff looks good. Then i just stumbled on to an idea that might seem idiodic but... Seems like in your http example there is 1:1 mapping between attributes, and the "template option names". Why not have this --opt foo=bar describe any attribute name ? Benefits:
Cons:
Again, we come back to we need more concrete examples. Currently the http feature is kind of already implemented in adagios via okconfig > add service |
|
(so a quick summary, i dont see a problem with the code per se, but i worry that the feature could be implemented without a need for another config file. |
|
The destination-filename is a stumbling block, plus alternate service_descriptions which I want to address. Instead of going with the mssql, I'm going to post an example using check_postgres which highlights the problem more adequetaly. There we have server based checks and then we have per-database checks. The per database checks would need to be noted in the service_description and I would see adding a postgres-{hostname}-{database}.cfg for each database. Why a configuration file? I want to enrich the user experience of arguments where there is a description of what the option is and even going with enum fields where there are only a few valid options. No functionality has been implemented yet but consumers can read the description field and I'm working on the functionality of The 1:1 mapping is almost correct but I'm offering for sane defaults where something like VIRTUAL_HOST can be derived from HOSTNAME by default but the user is allowed to specify his own VIRTUAL_HOST where appropriate. |
|
Ok sounds good. Postgres template sounds nice. |
|
Additionally, thoughts on a less confusing name ? (suggestion: template variables) |
What it does
Enables template options via --opt VAR=SOMETHING
What it does NOT
Break how everything used to work, so old templates still work
Description
Contents of the file (/etc/nagios/okconfig/hosts/default/www.okconfig.org-http-vhost.okconfig.org.cfg) become
Then there is the configuration for the template options.
/usr/share/okconfig/examples/http.yml
It still uses the example file which now looks like this: