Page 1 of 1

Re: [Nagios-devel] Re: [Nagios-users] ANNOUNCE: Nagios::WebTransact and Nagios::Config on CPAN!

Posted: Mon Jul 28, 2003 11:44 am
by Guest
--- Russell Adams wrote:
> Any plans for creating a module to write Nagios configs?
>
> Perhaps dump a hash tree out to config file, optionally with
> optimizations?

The system I use here is template-driven. I have a template for what I
want a service or hostgroup to look like, with replacement variables in
the template file. Then I load the template into perl and do a simple
search/replace on the template code.

Template-driven configuration is generally easier than using hash trees
because there's a lot of stuff I don't care about in the program that's
easier to edit in a text file. For instance, I may want to change
timeout or check command or so forth in the text file and then just
re-run the config maker program using the template.

If Nagios ever adopts XML config files, which it should, then XSLT
provides an existing mechanism to generate config files via templates.






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]