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.
Bulk disabling a service across all hosts?
-
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?
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:
Once this runs, you will need to apply the configuration
Configure -> CCM -> Apply Configuration
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 nagiosqlConfigure -> CCM -> Apply Configuration
Re: Bulk disabling a service across all hosts?
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?
Thanks for pointing out my mistake, I edited the post to reflect the correct database... 