Page 1 of 1

$HOSTNAME$ Incorrect in Email Notification

Posted: Tue Apr 01, 2014 3:13 am
by peakyblinder
Hi,

I have just configured email notification for Status Alerts.
I have a continuous WARNING being reported for low disk space on a Windows server. This is fine, there is still 20GB left and more for testing the notifications.
It reports the warning perfectly fine apart from the $HOSTNAME$, instead it reports the $HOSTALIAS$.

This is how the email notification looks;
***** Nagios *****

Notification Type: PROBLEM

Service: C:\ Drive Space
Host: EBe****** Dev
Address: xx.xx.xx.xxx
State: WARNING

Date/Time: Tue Apr 1 08:06:35 BST 2014

Additional Info:

c:\ - total: 29.99 Gb - used: 24.17 Gb (81%) - free 5.82 Gb (19%)

This is the host definition;
define host{
use windows-server ; Inherit default values from a template
host_name SV****76 ; The name we're giving to this host
alias EBe****** Dev ; A longer name associated with the host
address xx.xx.xx.xxx ; IP address of the host
hostgroups iis-servers ; The group this server is a member of
notes EBe****** Dev ; Show application name in Extended Information Screen
}

Anyone have any ideas?
I'm running Nagios 3.5.1 by the way.

Much Appreciated,


**** Update ****
Just received an alert and noticed this in the nagios.log file;
[1396339595] SERVICE NOTIFICATION: craig;SV****76;C:\ Drive Space;WARNING;notify-service-by-email;c:\ - total: 29.99 Gb - used: 24.17 Gb (81%) - free 5.82 Gb (19%)

Re: $HOSTNAME$ Incorrect in Email Notification

Posted: Tue Apr 01, 2014 3:53 pm
by abrist
Your notification command most likely uses the $HOSTALIAS$ macro instead of the $HOSTNAME$ macro. Can you post your notification handler (notify-*-by-email) commands?

Re: $HOSTNAME$ Incorrect in Email Notification

Posted: Fri Apr 04, 2014 8:05 am
by peakyblinder
abrist wrote:Your notification command most likely uses the $HOSTALIAS$ macro instead of the $HOSTNAME$ macro. Can you post your notification handler (notify-*-by-email) commands?
Yup, my bad. Service and host email notification was using different macros.

Re: $HOSTNAME$ Incorrect in Email Notification

Posted: Fri Apr 04, 2014 9:16 am
by tmcdonald
Safe to lock up the thread now?

Re: $HOSTNAME$ Incorrect in Email Notification

Posted: Fri Apr 04, 2014 9:27 am
by peakyblinder
tmcdonald wrote:Safe to lock up the thread now?
Yeah, can close this off now. Thanks,