You are correct, that definitely wouldn't do it. Personally, I would probably create a service template, on top of the existing wizard templates, that set's 90% of what I need. Then after my script runs cfgmaker, I'd probably parse the output for what interfaces need to be added, and script the config creation from there. Finally just import them with reconfigure_nagios.sh.
You could script the webui or internal functions in another php script as well. It all depends on if you think you will need to do this again or just a one off.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Disclaimer: I have worked with Nagios in the past, but I've forgotten a lot of it. And I have no experience with Nagios XI.
So, from your post I gather the following:
a) A service template is a script?
b) The "Network wizard" template is a service template?
c) In the case of the "Network wizard" service template it also runs the MRTG cfgmaker script?
b) After the cfgmaker script has run, some parsing of the script out happens and from that additional Nagios config is created.
e) After that reconfigure_nagios.sh needs to run. I figure this is just a "reload config" operation like you have with other daemons?
So now I understand how I can create a new Network wizard template based on the exisiting one that will save me time by setting up a few options already, the way I like them?
But how can I run this new wizard 360 times with input from say a CSV file containing switch IPs and names? Can I call this script from the command line on the Nagios server? Or via an HTTP API?
In the mean time I talked with Willem about this and cleared up a lot of my confusion
We came to the conclusion that our best course of action would be to write a bash script that basically does what the Network Wizard does (I now also understand what the wizard actually does).
But using our own service and host templates (based on the templates of the wizard). This would also allow us to (if needed) add some extra logic that is not in the wizard right now and to easily run this script automatically for a batch of switches.
That sounds like an awesome idea, and I could have sworn that there was a script that did something similar floating around out there. I'll try to hunt it down as it may offer some help, won't cover the XI side of things, but it will for core.
I've had no luck digging it up so far, unfortunately. If/when you do write your script, you will want to split your devices up into separate mrtg configuration files, just take a look at how it is done currently, in XI 2014. Attached is the script that splits the mrtg configurations up to to increase performance. Standard perms are: