Hello,<br><br>Since today I have almost the same problem as Jim. <br>The $HOSTALIAS$ macro works fine for all the checks, except one host alias is wrong. I got aware of it today. <br><br>Same version as Jim's, 3.2.3, compiled from source as well.<br>
<br>Host config:<br><br><font size="1"><span style="font-family: courier new,monospace;">define host{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        use                     linux-platform-demo     ; Name of host template to use</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                                        ; This host definition will inherit all variables that are defined</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                                        ; in (or inherited by) the linux-server host template definition.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        host_name               server14</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        alias                   SERVER14-RANDOMDEMO</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        address                 192.168.0.14</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        }</span><br></font><br>
However in the notification e-mail the alias appears like this:<br><br>

<p class="MsoPlainText"><i><font size="1"><span lang="EN-US">Subject: ** PROBLEM Service Alert: SERVER17-RANDPROD/Service Check is CRITICAL **</span></font></i></p>



<p class="MsoPlainText"><i><font size="1"> ***** Nagios *****</font></i></p>

<p class="MsoPlainText"><i><font size="1"> Notification Type: PROBLEM<br>Service: Service Check<br>Host: SERVER17-RANPROD<br>Address: 192.168.0.14<br>State: CRITICAL<br>Date/Time: Mon Jul 11 11:12:20 CEST 2011<br><br>Additional Info:



</font></i></p><i><font size="1">CRITICAL No connection to 192.168.0.20!</font></i><br><br>Note that the IP address is correct. Only the Host (which uses $HOSTALIAS$ if I'm not mistaken) is wrong. As this is also used in the subject of the mail, a great confusion happened here at work today ;-).<br>
<br>I checked all host definitions for wrong alias values, but did not find so. Anyone got an idea?<br>Maybe this is related to the problem Jim found, too. <br><br>thx<br>ck<br><br><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 8:16 PM, Jim McNamara <span dir="ltr"><<a href="mailto:jim@packetalk.net">jim@packetalk.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><u></u>


  
  

<div>
Hello all. I'm seeing an unexpected behavior in my nagios installs, and I'd appreciate some insight as to what I did incorrectly. <br>
<br>
This is nagios version 3.2.3 compiled from source.<br>
<br>
I added the $HOSTALIAS$ macro to the emails nagios generates, as often information in the alias makes it clearer which device has the problem. The host email looks like this:<br>
<br>
# 'notify-host-by-email' command definition<br>
define command{<br>
        command_name    notify-host-by-email<br>
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nAbout: $HOSTALIAS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<br>

        }<br>
<br>
The same modifications were made to the notify-service-by-email as well.<br>
<br>
This works somewhat as intended, it does add an "About:" line, but the value for $HOSTALIAS$ is not consistent.<br>
<br>
In the /usr/local/nagios/etc/objects/localhost.cfg file the host is defined as:<br>
<br>
define host{<br>
        use                                linux-server <br>
        host_name               localhost<br>
        alias                             old gray box on the metal stand<br>
        address                      127.0.0.1<br>
        hostgroups              linux-servers<br>
        }<br>
<br>
When I click on Host followed by localhost in the web interface for nagios, I get a page with this data at the top:<br>
<br>
Host
old gray box on the metal stand
(localhost)
<br>
In addition, the line "old gray box on the metal stand" is listed as the alias for localhost in /usr/local/nagios/var/objects.cache:<br>
<br>
define host {<br>
        host_name       localhost<br>
        alias   old gray box on the metal stand<br>
        address 127.0.0.1<br>
        check_period    24x7<br>
        check_command   check-host-alive<br>
<br>
When I receive a host email about localhost, the About: line in the email which should to my understanding contain the value of $HOSTALIAS$, instead has "localhost" listed where the $HOSTALIAS$ (old grey box on the metal stand) is expected.   <br>

 <br>
Here is the text of a recent email:<br>
<br>
<tt><font color="#3c3c3c">***** Nagios *****</font></tt><br>
<br>
<tt><font color="#3c3c3c">Notification Type: RECOVERY</font></tt><br>
<br>
<tt><font color="#3c3c3c">Service: current load</font></tt><br>
<tt><font color="#3c3c3c">Host: localhost</font></tt><br>
<tt><font color="#3c3c3c">About: localhost</font></tt><br>
<tt><font color="#3c3c3c">Address: 127.0.0.1</font></tt><br>
<tt><font color="#3c3c3c">State: OK</font></tt><br>
<br>
<tt><font color="#3c3c3c">Date/Time: Wed Jun 8 13:41:01 EDT 2011</font></tt><br>
<br>
<tt><font color="#3c3c3c">Additional Info:</font></tt><br>
<br>
<tt><font color="#3c3c3c">OK - load average: 1.18, 2.55, 2.34</font></tt><br>
<br>
<br>
<br>
I checked and multiple copies of nagios aren't running, so I'm guessing I did something incorrect with the macro?<br>
<br>
Interestingly, this is happening to about half of the hosts I'm receiving emails for. Sometimes the $HOSTALIAS$ is correct, and other times it seems $HOSTALIAS$ is incorrect.<br>
<br>
<br>
</div>

<br>------------------------------------------------------------------------------<br>
EditLive Enterprise is the world's most technically advanced content<br>
authoring tool. Experience the power of Track Changes, Inline Image<br>
Editing and ensure content is compliant with Accessibility Checking.<br>
<a href="http://p.sf.net/sfu/ephox-dev2dev" target="_blank">http://p.sf.net/sfu/ephox-dev2dev</a><br>_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>