Hostalias

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
def103
Posts: 2
Joined: Wed Feb 16, 2011 9:55 am

Hostalias

Post by def103 »

I'm trying to change some options in the alert configuration.

In Nagios you can enter the host Alias information such as for example:

host_name wsus01
alias Microsoft Wsus Update server
address wsus.domain.local

Now i want in my host and service alert the Alias in the alert e-mail or sms.

I tried to following macro but that didn't work: $HOSTALIAS$

My command to send the e-mail is like this:

Code: Select all

/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

Instead of the $HOSTALIAS$ is just displays the hostname.
I'm running Nagios 3.2.3

Is it possible to display the alias in the notification ?
bushi
Posts: 9
Joined: Wed May 26, 2010 10:36 am

Re: Hostalias

Post by bushi »

It should work exactly this way, but imho there is currently a bug in nagios which results in old data within the hostalias field. (http://support.nagios.com/forum/viewtop ... lias#p6218)

Try shut down nagios, delete retention.dat and restart nagios.
def103
Posts: 2
Joined: Wed Feb 16, 2011 9:55 am

Re: Hostalias

Post by def103 »

Try shut down nagios, delete retention.dat and restart nagios.
I tried this and it looks like this works now

Thanks for your support.
Locked