Bulk disabling a service across all hosts?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cscholz
Posts: 36
Joined: Wed Mar 07, 2012 4:40 pm

Bulk disabling a service across all hosts?

Post by cscholz »

Many of our linux servers are not connected to the public internet, and therefore the default Yum Updates check is not required. I don't want to bulk DELETE them (lest we need to go back and turn it on, on a one off basis), I simply wish to deactivate all services related to Yum.

I did a search in the core configuration module and was able to locate all the services, but there is no option to deactivate all checked. One may only delete or copy those entries.

Can anyone suggest a method of bulk disabling service checks? Is there a query I can run against the database that will take care of this for me (setting all services to active = 0, for instance)? I'm not familiar enough with the schema to do this on my own.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Bulk disabling a service across all hosts?

Post by scottwilkerson »

This feature isn't currently available but is under development in the coming CCM.

If you have a ton of these you could do it via SQL (make a backup before proceeding)
Then you could run:

Code: Select all

echo "UPDATE tbl_service set active=0 WHERE service_description like '%yum%';" | mysql -u root -pnagiosxi nagiosql
Once this runs, you will need to apply the configuration
Configure -> CCM -> Apply Configuration
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cscholz
Posts: 36
Joined: Wed Mar 07, 2012 4:40 pm

Re: Bulk disabling a service across all hosts?

Post by cscholz »

Thanks, this worked. However, the table is "nagiosql", not nagios. After some head scratching I figured it out! Thanks for the help, Scott.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Bulk disabling a service across all hosts?

Post by scottwilkerson »

Thanks for pointing out my mistake, I edited the post to reflect the correct database... :oops:
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked