Page 1 of 1

Bulk add service to multiple hosts

Posted: Fri Dec 13, 2024 10:10 am
by cunningrat
Apologies if this is a dumb question, I am very new to Nagios XI.

I need to add a service to 700+ existing hosts. Problem is, the command arguments ($ARG1$, $ARG2$, etc) will be different for each one.

Is there a way to do a bulk import from a csv/xml/text file or anything like that? I've looked at the Bulk Host Cloning/Import wizard and the Bulk Modification tool, and neither of them appears to do what I want.

Thanks in advance!

Re: Bulk add service to multiple hosts

Posted: Fri Dec 13, 2024 10:30 am
by cnorell
cunningrat,

If you have a host template setup that matches roughly what you need, the bulk cloning and import wizard should get you pretty close to where you need to be: https://assets.nagios.com/downloads/nag ... Wizard.pdf

Best Regards,

Cory Norell

Re: Bulk add service to multiple hosts

Posted: Fri Dec 13, 2024 1:28 pm
by AngeloMileto
What are the values that will be different for ARG1/2? If it's something you could do a quick bash script for you can create the files in the /usr/local/nagios/etc/import directory and then use the import function of the config to pull them in.

Is there a way to create a single service and then just assign the 700+ hosts to that service check? The advantage there is also that if you need to make a change to the service check later, you don't have to edit 700+ hosts but only 1 service.