Page 1 of 1

Individualy server notification

Posted: Wed Mar 27, 2013 8:20 pm
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.

Re: Individualy server notification

Posted: Thu Mar 28, 2013 7:37 am
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

Re: Individualy server notification

Posted: Thu Mar 28, 2013 10:15 am
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.

Re: Individualy server notification

Posted: Thu Mar 28, 2013 1:22 pm
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.

Re: Individualy server notification

Posted: Thu Mar 28, 2013 2:55 pm
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.

Re: Individualy server notification

Posted: Fri Mar 29, 2013 4:53 pm
by Tho Phan
Thank you all. I can make it work now.