Individualy server notification

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
Tho Phan
Posts: 3
Joined: Wed Mar 27, 2013 8:08 pm

Individualy server notification

Post by Tho Phan »

Hi,
We have few system admin and each system admin own different servers. So, I want to set Nagios (core) send notification send to him/her only if his/her own server down. I am using nagios version 3.4.3 and with Centos 6.3. Please help. I am a new nagios user.
Regards
Tho.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Individualy server notification

Post by gshergill »

Hi Tho,

So your nagios server is monitoring multiple hosts, and each host has it's own admin?

In your contacts.cfg define each admin with their email address, etc.

In your hosts.cfg add to each host the line below, replacing it with the host's admins name;

Code: Select all

contacts      <admin contact_name>
I assume your services are using the generic service template?

Code: Select all

use     generic-service
Please correct me if I am wrong, but the best bet would be to force your services to use your hosts contacts definition by commenting out the contacts and contact_group line from the generic-service template in templates.cfg.

Hope this helps.

Kind Regards,

Gary Shergill
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Individualy server notification

Post by slansing »

I would go with Gshergill's suggestion of using contacts, as this allows you to more easily control who you have assigned to receive notifications, and make quick changes if necessary.
Tho Phan
Posts: 3
Joined: Wed Mar 27, 2013 8:08 pm

Re: Individualy server notification

Post by Tho Phan »

Thank you Gary and Slansing
I did not use template.cfg. What I did is I copied the localhost.cfg and modified it for each server (ex:I get 20 servers then I will have 20 .cfg file for each server and locate them in the nagios.cfg file). And in the contact.cfg file, and in the original define contact session I put in the admin group email address.
So, I will define the contact name for each admin. So, could you tell me which session in the hosts.cfg file should I add the lines "contacts <admin contact_name>?

Regards,
Tho.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Individualy server notification

Post by abrist »

You could put all contacts into a contactgroup and then set the contactgroup for each host.
http://nagios.sourceforge.net/docs/3_0/ ... ntactgroup

Or you can set the "contacts" directive for each individual host.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Tho Phan
Posts: 3
Joined: Wed Mar 27, 2013 8:08 pm

Re: Individualy server notification

Post by Tho Phan »

Thank you all. I can make it work now.
Locked