e-mail notification shows alias instead of hostname

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
MichielvM
Posts: 160
Joined: Thu Oct 24, 2013 3:48 am

e-mail notification shows alias instead of hostname

Post by MichielvM »

I give up, I've scrounged this forum, found numerous related issues and solutions, none of which apply to my situation.
We have some 30 XI servers, all setup following the same procedure.
Be that as it may, I see differences in email notifications. Some servers (most) show email notifications with the correct hostname in the email subject and body text, whereas others (a few large ones) show alias in the subject and body.

Like this:

Code: Select all

***** Nagios Monitor XI Alert *****

Notification Type: PROBLEM

Service: <any old service>
Host: [b]windows server 2008 - iis - sql[/b]
Address: <ipaddress>
State: CRITICAL
So far I crosschecked with 4 servers:
- Notification Commands (notify-host-by-email and notify-service-by-email)
- Clicked username and Notification Messages
- Notification Settings Management
The variable used is %host%
I checked the actual Hosts and Services CFG files.

Everything is exactly the same, except for the final e-mail.
What am I missing??

For the record: we're using version 2012R2.5 and a few 2.9.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: e-mail notification shows alias instead of hostname

Post by lmiltchev »

So far I crosschecked with 4 servers:
- Notification Commands (notify-host-by-email and notify-service-by-email)
- Clicked username and Notification Messages
- Notification Settings Management
The variable used is %host%
Nagios XI users don't use notify-host-by-email and notify-service-by-email notification handlers. They use xi_host_notification_handler and xi_service_notification_handler. Contacts only use notify-host-by-email and notify-service-by-email notification handlers but they cannot modify their notification options (Notification Messages)...

I would recommend reading the following two documents:

http://assets.nagios.com/downloads/nagi ... ntacts.pdf

http://assets.nagios.com/downloads/nagi ... ations.pdf

Find out who is the xi user or the "contact only" receiving these alerts, then check what notification handlers he/she is using. If this is a user, check the user's Notification Options.

I am moving this topic to the Nagios XI support. It seems like you posted on the Nagios Core forum by mistake.
Be sure to check out our Knowledgebase for helpful articles and solutions!
MichielvM
Posts: 160
Joined: Thu Oct 24, 2013 3:48 am

Re: e-mail notification shows alias instead of hostname

Post by MichielvM »

It looks like "notify service by email" handler is the culprit here.
$HOSTALIAS$ in one, and $HOSTNAME$ in another.

What I don't understand is that I have different versions of these handlers.
All our XI servers are built from scratch using a predefined procedure.

Any thoughts on that score?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: e-mail notification shows alias instead of hostname

Post by abrist »

MichielvM wrote:All our XI servers are built from scratch using a predefined procedure.

Any thoughts on that score?
The notify-*-by-email commands are from core, so I would presume that they are configured in core with $HOSTALIAS$. Changing $HOASTALIAS$ to $HOSTADDRESS$ or $HOSTNAME$ should resolve your issues.
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.
Locked