bulk changes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

bulk changes

Post by paltel »

Hello ,

I've been asked to do bulk change of contact group for all hosts in a hosts group also with all relevant services , the change include thousands of services and hundreds of hosts , the only thing I have is hostgroup name .

I could not find any tool to do this so I go to mysql nagiosql database and did some queries and changed what I need .

now I have all changes correct when browsing core config manager but changes not reflecting to nagios , whenever yo browse any of these hosts/services in CCM and click just save without changes it will detect it , but for sure cannot do the same for all changes .

is there any method/script to force nagios DB against config files and force sync ?

thanks for help
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: bulk changes

Post by Box293 »

paltel wrote:I've been asked to do bulk change of contact group for all hosts in a hosts group also with all relevant services , the change include thousands of services and hundreds of hosts , the only thing I have is hostgroup name .

I could not find any tool to do this so I go to mysql nagiosql database and did some queries and changed what I need .
This can be performed using the Bulk Modifications tool.

CCM
Tools
Bulk Modifications

NOTE: This is a part of the Enterprise Edition license. If you did not purchase this then you can activate the trial which will let you use the tool and get a taste of it's power.
paltel wrote:now I have all changes correct when browsing core config manager but changes not reflecting to nagios , whenever yo browse any of these hosts/services in CCM and click just save without changes it will detect it , but for sure cannot do the same for all changes .

is there any method/script to force nagios DB against config files and force sync ?
Go into CCM
Tools > Write Config Files
Click the Delete button
Quick Tools > Apply Configuration
Click the Apply Configuration button
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: bulk changes

Post by paltel »

Thanks for kind reply ,

how come this is doable via ccm bulk modifications tool ? lets say I have 1000 host in host group named " IT servers " , each host has a lot of services , how can I select all services that belongs to this host group ? as no service groups defined ?

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

Re: bulk changes

Post by lmiltchev »

If you used the Bulk Modifications Tool, and clicked on the "Select Hosts using Hostgroups", the contact group would be added only to hosts, members of your hostgroup. In order to add the contactgroup to services, you will need to click on "Select Services", select all of the services you need to add the contactgroup to, and add them in one go.
example01.PNG
With so many services (i.e. on 1000 hosts), this could be somewhat a tedious task. You may want to try modifying your services from the command line, by implementing some kind of scripting solution. Please review your "Automated Host Management In Nagios XI" document here:

https://assets.nagios.com/downloads/nag ... gement.pdf

Hope this helps.

Edit: I assumed you have specified some contacts implicitly to these services. In case you didn't, and the only contacts you would like to add are these in the contactgroup, you could use the "Select Hosts using Hostgroups" option in the "Bulk Mod" tool. Contact groups in services will be inherited from the hosts they are associated with via implied inheritance.

https://assets.nagios.com/downloads/nag ... tance.html
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: bulk changes

Post by gormank »

Have a look at write config files in CCM, under tools.
In the long run using templates would allow this info to be stored in one place, making use of the bulk change tool, and modifying the DB directly unnecessary.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: bulk changes

Post by hsmith »

Thanks @gormank.

@paltel, does this answer your question?
Former Nagios Employee.
me.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: bulk changes

Post by ssax »

I believe gormank is correct. When you changed the information in the DB (not something we recommend at all) I'm not sure if the last update time actually changed or not.

Go to Configure > Core Config Manager > Tools > Write Config Files
- Click Delete (don't worry, it's safe, they get re-written)
- Click Write
- Click Verify to make sure you don't have any errors
- Now apply configuration

Thank you
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: bulk changes

Post by paltel »

Hello ,

Thanks , Delete config and re apply them solved my problem

Regards
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: bulk changes

Post by ssax »

That's great to hear! Locking the thread and marking it as resolved.
Locked