Remove contact from multiple (>1,000) service monitors

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ibmkenexa
Posts: 28
Joined: Wed Feb 13, 2019 4:05 am

Remove contact from multiple (>1,000) service monitors

Post by ibmkenexa »

Taking the "memory" service monitor as an example which has multiple contact DL's assigned.

Wish to remove a specific contact DL from the memory service monitor in a time efficient manner.
Realize this can be done by the 'Bulk modification tool' and the 'remove contact option' but just too many specific mouse clicks to make.

Can you recommend another way to achieve this ask/task?
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Remove contact from multiple (>1,000) service monitors

Post by gormank »

Newer versions of XI (5+) can probably do it through the new API. I haven't gotten around to using it much so I can't say more.
You can also use the old copy .cfg files, edit with sed, and import. You import by copying files into the import dir and running the reconfig script.
I guess with that many services you have lots of services that do the same thing such as check CPU usage for example. I typically define one service of a type (such as CPU) and keep all info in templates and attach hostgroups to the service. This way if I want to change contacts, thresholds, etc. I just change them in the template and I'm done. I do the same w/ hosts.

https://www.google.com/url?sa=t&rct=j&q ... C6fWmpA4yC

https://www.google.com/search?client=fi ... ent=psy-ab

https://www.google.com/url?sa=t&rct=j&q ... I9GR1pAvme
Locked