Bulk add mssql database services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
brucej543
Posts: 134
Joined: Thu Jun 21, 2018 9:33 am

Bulk add mssql database services

Post by brucej543 »

I have a project that has an SQL database server with over 300 databases on it. The host is already defined and the mssql services. I have one of the databases defined with the mssql_database monitoring 10 services. What is the best way to bulk add the remaining databases using the same 10 mssql_database monitoring services? I have reviewed the Bulk Host Cloning and import wizard and it does not look like it would work for this project because it does look like it would address each database name.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk add mssql database services

Post by ssax »

You would need to copy the services and change the DB names, to speed it up you could technically do something like this:

Code: Select all

cp /usr/local/nagios/etc/services/configname.cfg /usr/local/nagios/etc/import/newconfigname.cfg
sed -i 's/OLDHOSTNAME/NEWHOSTNAME/g' /usr/local/nagios/etc/import/newconfigname.cfg
sed -i 's/OLDDBNAME/NEWDBNAME/g' /usr/local/nagios/etc/import/newconfigname.cfg
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
brucej543
Posts: 134
Joined: Thu Jun 21, 2018 9:33 am

Re: Bulk add mssql database services

Post by brucej543 »

Thanks for your reply. I am trying to keep all the databases to be listed under the single host that these reside on. Using a new cfg file adds the services as the name of the cfg file. Can I just add the additional DB services to the existing services cfg file then import the revised cfg file? If this can be done, is there a limit to number of services to add at one time?
brucej543
Posts: 134
Joined: Thu Jun 21, 2018 9:33 am

Re: Bulk add mssql database services

Post by brucej543 »

ssax - Thanks for you info. Doing bulk services with no issues.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk add mssql database services

Post by ssax »

That's great to hear! Do you still have any outstanding questions on this or are we okay to lock this up and mark it as resolved?
brucej543
Posts: 134
Joined: Thu Jun 21, 2018 9:33 am

Re: Bulk add mssql database services

Post by brucej543 »

Thanks again and this can Locked up and marked as resolved.
Locked