$HOSTNAME$ Incorrect in Email 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
peakyblinder
Posts: 63
Joined: Tue Mar 25, 2014 4:39 am

$HOSTNAME$ Incorrect in Email Notification

Post 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%)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: $HOSTNAME$ Incorrect in Email Notification

Post 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?
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.
peakyblinder
Posts: 63
Joined: Tue Mar 25, 2014 4:39 am

Re: $HOSTNAME$ Incorrect in Email Notification

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: $HOSTNAME$ Incorrect in Email Notification

Post by tmcdonald »

Safe to lock up the thread now?
Former Nagios employee
peakyblinder
Posts: 63
Joined: Tue Mar 25, 2014 4:39 am

Re: $HOSTNAME$ Incorrect in Email Notification

Post by peakyblinder »

tmcdonald wrote:Safe to lock up the thread now?
Yeah, can close this off now. Thanks,
Locked