Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yesterday one of my co-workers pointed out that he not received any email-alerts from Nagios recently. I checked the particular config-file but nothing has changed. In case of an alert an email is sent to two groups (admin,sap) but only one group (admin) is receiving the alerts by email.
Code:
define host{
use windows-server,host-pnp ; Inherit default values from a template
host_name xxxx ; The name we're giving to this host
alias xxxx ; A longer name associated with the host
contact_groups sap,admin
notification_period daytime
address xx.xx.xx.x ; IP address of the host
}
In order to check if the problem was related to exchange 2003, i manually tested the sap emailaddress (mail -s test xxxx@xxx.xx). The sap emailaddress received the test mail so that made me think that exchange is not the problem.
I made a small adjusment to the notify-host-by-email command and forced a warning/error for that particular host to see the contents from variable $CONTACTEMAILS$.
I noticed that the $CONTACTEMAILS$ variable was only containing the emailaddress from the admin group and was missing the emailaddress from the sap group when the mail command is executed.
Anybody an idea what is causing this problem and how i can solve it?
In my host definitions I have a space after the comma between groups whereas you don't. That probably isn't the problem but it can't hurt to try it. (e.g. "sap, admin").
Also the method used to notify users is actually defined in contacts.cfg. The groups are defined in contactgroups.cfg.
You should first verify the people you think are in the second group are actually in it in contactgroups.cfg. You should then examine those people in contacts.cfg and see what the specific entries are defined to use for notification. (For example in a recent alert I actually had 4 separate groups defined in the host entry. All 4 of those are in contactgroups.cfg. 3 of those groups contain only people from contacts.cfg that have host-notify-by-email whereas the other group contains only people from contacts.cfg that have host-notify-by-epager. In looking at history for that alert I see it used both host-notify-by-epager and host-notify-by-email (as appropriate for the users defined) so if I had looked only at what was happening with host-notify-by-email it would have appeared to me that the other users weren't getting notified even though they were.
So for each of the contacts in contacts.cfg defined in the groups in contactgroups.cfg you see the following?
Code:
host_notification_commands notify-host-by-email
What file has your notify-host-by-email definition? Is it possible you're looking at the wrong one (e.g. do you have it defined in both commands.cfg and misccommands.cfg)?
After reading your first reply more carefully, i noticed service definitions in some of our config files did not contain a "contact_group" entry. This caused the service definition to inherance the "contact_group" from the service template which only contains the admins contact_group.
I don't know how this could have been working in the past, but after i made the required changes everything is working again.
Glad you got it resolved. Can you go to Thread Tools at top of the page and mark this solved. It helps others when searching to find solved threads first.
As an FYI: host-notify-by... and service-notify-by... are separate entries in my setup so likely are in yours as well. Typically you would use the host-notify-by... for servers defined in hosts.cfg being completely unreachable whereas service-notify-by... are used for the individual services defined in services.cfg
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.