Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple directives per line in config #471

Open
fermino opened this issue Jul 18, 2024 · 2 comments
Open

Multiple directives per line in config #471

fermino opened this issue Jul 18, 2024 · 2 comments

Comments

@fermino
Copy link

fermino commented Jul 18, 2024

Hi! I would like to implement the following syntax in the configuration files. At work we have a ton of hosts and it would simplify a lot of management. I am willing to implement it myself in the parser, but I want to discuss it here first so that the best syntax definition could be used and if it useful for others, maybe have it merged upstream.

define host{ host_name bla0037;  use template-bla }
define host{ host_name bla0042;  use template-bla }

https://serverfault.com/questions/737230/nagios-configuration-syntax-multiple-directives-per-line

Any thoughts?
Thanks!

@sni
Copy link
Contributor

sni commented Jul 18, 2024

tbh, i think it is a lot easier to fix the script which manages your hosts.

@nook24
Copy link
Member

nook24 commented Jul 19, 2024

I think this is a huge change and a lot of effort to implement. Not only do you need to modify the parser but also all test cases and example configs.
All this effort to get a new config format, which is not a standard format and would require everyone to write its own parser. (Like with the current format)

With all this in mind, I would strongly recommend to patch your config generator. This will probably only take 1 or 2 hours while implementing a new config format will take days - and weeks to fix all edge cases.

Instead of patching the current parser I would suggest to add a new parser for a standard config format such as YAML, TOML, INI, JSON or whatever fits best.
Naemon could use the file extension to determine which parser to use (.cfg go with current parser, .toml go with tomlc99 parser just to name an example). This way not only Naemon would benefit, but also all applications that deal with Naemon configuration files. Still a lot of effort.

Maybe you could explain a bit more what issues you are facing with the current format and why a new formation would simplify a lot of management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants