Page 1 of 1

Adding hundreds of Routers

Posted: Wed May 16, 2018 2:57 pm
by Matthew.Cary
Up until now I've been using a template based approach to getting my Servers into XI, and it's been working well. I now need to get about 5-600 cisco switches into Nagios and I'm finding the devil is in the details.

Running the Network Switch/Router works great and I can get one router into XI just great, but I really dread doing this up to 600 times, I'd much rather automate or template the process.

The approach I've been taking with server templates doesn't seem to transfer well to Routers as XI wants a mrtg config file for each router to graph performance and I'm discovering I do need to let XI interrogate each router via SMTP to get port configs (which the wizard does, but I don't see an easy way to template that)

Surely there is a better way than just running the wizard over and over again?

Re: Adding hundreds of Routers

Posted: Wed May 16, 2018 3:26 pm
by npolovenko
Hi, @Matthew.Cary. You're right, network switch/router wizard is hard to automate because it not only creates service and host checks but does a custom port autodiscovery, creates new mrtg config files. So there is no easy way to automate this, unfortunately.
You could come up with your own script that will generate mrtg configs+create service and host checks. Autodiscovery part will be much harder to implement though.

Re: Adding hundreds of Routers

Posted: Thu May 17, 2018 12:21 pm
by rbond
One might try the API method for adding hosts as it will allow you to add batches of objects like hosts all from one script. The Nagios Help document found under the help menu will show how to use the api for the POST Config/Host endpoint will help you best. I've used it and it works great. version 5.5 may have improvements in this regard. Other than that, one may look into creating other shell scripts from external automation that can quickly create host config files from a list.

Re: Adding hundreds of Routers

Posted: Thu May 17, 2018 2:59 pm
by npolovenko
Thanks for the advice, @rbond. Creating hosts with API is definitely a good way to start automating this. A bigger challenge I see is creating MRTG config files. And even bigger is automating a port discovery on a switch/router.