So I'm working on moving away from Solarwinds to Site 24x7's server monitoring agent. One of the things that it supports is a JSON configuration file of Nagios scripts to run with appropriate parameters. Obviously i want that file to be based off of a template, but I'm wondering how best to collect the data before writing the file. Currently my NRPE cookbook writes out multiple config files in /etc/nagios.d/ and different roles include multiple recipes from that cookbook. Now I need to collect that into one file. Are there any simple tricks that could help here? The only thing that I can think of is to create something like /opt/site24x7/monagent/plugins.d/<file.cfg> and then a delayed custom resource that collects them all together into a single file, but that feels really kludgy. Any advice would be appreciated, thanks.
Take a look at the accumulator pattern? https://blog.dnsimple.com/2017/10/chef-accumulators/