<div>Hi all:</div>
<div> </div>
<div>First of all, thank you very much for your support to other users, I have gone thru hundreds of your emails, but still I couldnt find the solution to my case...</div>
<div> </div>
<div>I have set up email notifications in nagios, and I do get emails, but I cant make Nagios send me any information like $hostname$ in the body of the email. When I tried the typical configuration for nagios, like:</div>
<div> </div>
<div><span lang="ES-MODERN">
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<p># 'notify-service-by-email' command definition</p>
<p>define command{</p>
<p>command_name notify-service-by-email</p>
<p>command_line /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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$</p>
<p>}</p></blockquote>
<p> </p>
<p>i wasnt getting emails.</p>
<p>Now a simplified version of the command:</p>
<p><span lang="ES-MODERN"> </span></p>
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<p># 'notify-service-by-email' command definition</p>
<p>define command{</p>
<p>command_name notify-service-by-email</p>
<p>command_line printf "%b" "$HOSTADDRESS$" | /usr/bin/mail -s Subject_of_email my_email_address</p>
<p>}</p></blockquote>
<p>does send me emails, but it doesnt translate the hostaddress, i get just a dollar sign in the body of the email.</p>
<p>I have tried to put hostaddress in small letters, with and without quotation marks, redone all the possible files that call the alert... and I am lost.</p>
<p>What can be wrong, please? How can I make Nagios translate those variables into the actual information they contain? (for the service checks, they actually work, I see the state change in the Nagios webserver, individually for all the hosts that I set up)</p>
<p>Thanks a lot,</p>
<p>Jorge</p></span></div>