How to cleanup unused (previuosly renamed) services?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

How to cleanup unused (previuosly renamed) services?

Post by dlukinski »

Hello XI support

We have many old services (directly renamed)
How to cleanup them properly?

Thank you
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to cleanup unused (previuosly renamed) services?

Post by hsmith »

Can you please give a little more detail on what's going on here? Do you have duplicate services? If you want to clean up services, you can just delete the ones you don't want.
Former Nagios Employee.
me.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: How to cleanup unused (previuosly renamed) services?

Post by vAJ »

If you've got a bunch of old/unused cfg files in your /hosts /services paths, you can use the CCM tools to purge these.

1. Backup your instance (CYA)
2. Go to CCM-->Tools-->Write Config Files
3. Click 'Delete' under "Delete All Host / Service Configuration Files"
4. Once that completes, go back and click 'Write', 'Verify', 'Restart' on the same screen to refresh all cfg files and restart the engine.
WriteConfigFiles.JPG
If you're talking about services that listed in the CCM, then you're stuck manually deleting them, I believe.
You do not have the required permissions to view the files attached to this post.
Andrew J. - Do you even grok?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How to cleanup unused (previuosly renamed) services?

Post by rkennedy »

Thanks @vAJ!

@dlukinski - let us know when you have a chance to look at the previous responses.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to cleanup unused (previuosly renamed) services?

Post by tmcdonald »

That'll definitely work for the config files, but for the CCM we'll need a bit more detail as @hsmith mentioned. You might try looking at the Bulk Modifications tool under the CCM -> Tools menu, but you'll either need the Enterprise Edition license, or to activate the free 60-day trial in order to use it.
Former Nagios employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to cleanup unused (previuosly renamed) services?

Post by dlukinski »

This is not what I meant, maybe I have mixed Core VS XI
- when service was renamed w/o using renaming tool in XI, will the old version simply disappear and is there any cleanups required VS database?

Thank you
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to cleanup unused (previuosly renamed) services?

Post by lmiltchev »

- when service was renamed w/o using renaming tool in XI, will the old version simply disappear and is there any cleanups required VS database?
It depends how you renamed it. If you renamed it in the CCM (CCM->Services->Edit->Change "Description"->Save->Apply Configuration), the "old version" would disappear as your service would be renamed. If you renamed it in the CLI, next time you apply configuration, all of the changes would be wiped out as the text configs will be overwritten with whatever is in the database.

How did you rename your service? Can you describe in more details?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to cleanup unused (previuosly renamed) services?

Post by dlukinski »

lmiltchev wrote:
- when service was renamed w/o using renaming tool in XI, will the old version simply disappear and is there any cleanups required VS database?
It depends how you renamed it. If you renamed it in the CCM (CCM->Services->Edit->Change "Description"->Save->Apply Configuration), the "old version" would disappear as your service would be renamed. If you renamed it in the CLI, next time you apply configuration, all of the changes would be wiped out as the text configs will be overwritten with whatever is in the database.

How did you rename your service? Can you describe in more details?
Renamed directly in CLI & CCM (XI)
- so old versions would be wiped - no need to worry? (say where service name or description was different and no renaming tool used)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to cleanup unused (previuosly renamed) services?

Post by hsmith »

As long as you do it in the UI, it should be renamed. If you do it via the command line, the changes will be lost next time you apply a configuration.
Former Nagios Employee.
me.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to cleanup unused (previuosly renamed) services?

Post by dlukinski »

hsmith wrote:As long as you do it in the UI, it should be renamed. If you do it via the command line, the changes will be lost next time you apply a configuration.
alright, when renamed, history is typically lost.
Now, does it remain in the DB, or also lost? (remains and has to be cleaned or removed by the system)
Locked