[Solved] Add contact to all services of a host

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
pricent
Posts: 2
Joined: Mon Oct 05, 2020 7:35 am

[Solved] Add contact to all services of a host

Post by pricent »

Hi,

I define services in two files:
* some services are in a file with the host definition
* some services are in a "services_for_all_hosts.cfg" with a line like:

Code: Select all

    host_name               *,!localhost
I would like to add a contact to all the services of a given host, but if I add this contact in the definition of the host, the services defined in "services_for_all_hosts.cfg" are not linked with the contact, only with the contacts listed in the template used for their definition.

How could I make this contact added to the services defined in "services_for_all_hosts.cfg", but only for a given host?

EDIT: I should add that all the contacts are handled with contact_groups objects in templates, and I'm trying to add the contact with a contacts field
Last edited by pricent on Thu Oct 08, 2020 3:48 am, edited 1 time in total.
pricent
Posts: 2
Joined: Mon Oct 05, 2020 7:35 am

Re: Add contact to all services of a host

Post by pricent »

SOLVED: a contact_group field was lying around in a service template, so the contacts and contact_groups fiels were overwritten with the value in the template, and the services did not get the contacts field in the host definition.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: [Solved] Add contact to all services of a host

Post by benjaminsmith »

Glad you got it worked out and thanks for sharing the solution.

We'll mark this was resolved.

Thank you for using the Nagios Community Forum!

Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked