<div>Hi again!</div>
<div> </div>
<div>Thank you for the quick answer, to begin with...</div>
<div> </div>
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<div>enable_environment_macros was already 1...</div>
<div> </div>
<div>I have tried $SERVICESTATE$ ($hoststate$ for the host notification), and i got "WARNING" in the email body... you cant believe how happy that has made me!</div></blockquote>
<div> </div>
<div>I copy one service definition</div>
<div> </div><span lang="ES-MODERN">
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<p>define host{</p>
<p>use generic-switch</p>
<p>host_name N7-Rack2</p>
<p>alias Backbone N7</p>
<p>icon_image multilayer_switch.gif</p>
<p>statusmap_image multilayer_switch.gd2</p>
<p>address 192.168.4.8</p>
<p>parents <a href="http://ns500.bne.es">ns500.bne.es</a></p>
<p>}</p></blockquote></span><span lang="ES-MODERN">
<p>define service{</p>
<p>use generic-service</p>
<div>host_name nagios, BNS31, BNS32, BNS49, BNS50, E1-MUSEO, E1-MUSICA_1, E1-MUSICA_2, E1-PROCESO_1, E1-PROCESO_2, E1-PROCESO_3, E1-PUBLICACIONES, E1-Ref_Biblio1, E1-Ref_Biblio2, E1-BELLAS_ARTES, E1-GERENCIA_1, E1-GERENCIA_2, E1-JARDIN_NORTE, E1-JARDIN_SUR, E1-JORGE_JUAN, E1-LABORATORIO, E1-MANUSCRITOS, E1-Salon italiano, E1-SALON_LECTURA, E1-UCI, N7-Rack2, N7-Rack3, <a href="http://ns500.bne.es">ns500.bne.es</a>, Salida LAN1 privado, Salida LAN2 publico, router alcobendas principal, Rediris, Router interministerial en BNE, Router interministerial en Cultura, Balanceador <a href="http://minos.bne.es">minos.bne.es</a>, Bluecoat 1, Bluecoat 2, SW1 Fujitsu, SW2 Fujitsu, SW3 Fujitsu, SW4 Fujitsu</div>
<div> </div>
<div>(and a few lines below...)</div>
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<p>service_description PING</p>
<p>check_command check_ping!200.0,20%!600.0,60%</p>
<p>normal_check_interval 5</p>
<p>retry_check_interval 1</p>
<p>}</p></blockquote></span>
<div>and what i see in the nagios webserver:</div>
<div>
<table class="data" border="0">
<tbody>
<tr>
<th class="data">Command Name</th>
<th class="data">Command Line</th></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check-host-alive"></a>check-host-alive</td>
<td class="dataOdd">$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_dhcp"></a>check_dhcp</td>
<td class="dataEven">$USER1$/check_dhcp $ARG1$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_ftp"></a>check_ftp</td>
<td class="dataOdd">$USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_hpjd"></a>check_hpjd</td>
<td class="dataEven">$USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_http"></a>check_http</td>
<td class="dataOdd">$USER1$/check_http -I $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_imap"></a>check_imap</td>
<td class="dataEven">$USER1$/check_imap -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_local_disk"></a>check_local_disk</td>
<td class="dataOdd">$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_local_load"></a>check_local_load</td>
<td class="dataEven">$USER1$/check_load -w $ARG1$ -c $ARG2$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_local_mrtgtraf"></a>check_local_mrtgtraf</td>
<td class="dataOdd">$USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_local_procs"></a>check_local_procs</td>
<td class="dataEven">$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_local_swap"></a>check_local_swap</td>
<td class="dataOdd">$USER1$/check_swap -w $ARG1$ -c $ARG2$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_local_users"></a>check_local_users</td>
<td class="dataEven">$USER1$/check_users -w $ARG1$ -c $ARG2$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_nt"></a>check_nt</td>
<td class="dataOdd">$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_ping"></a>check_ping</td>
<td class="dataEven">$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_pop"></a>check_pop</td>
<td class="dataOdd">$USER1$/check_pop -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_smtp"></a>check_smtp</td>
<td class="dataEven">$USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_snmp"></a>check_snmp</td>
<td class="dataOdd">$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_ssh"></a>check_ssh</td>
<td class="dataEven">$USER1$/check_ssh $ARG1$ $HOSTADDRESS$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="check_tcp"></a>check_tcp</td>
<td class="dataOdd">$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$</td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="check_udp"></a>check_udp</td>
<td class="dataEven">$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$</td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="notify-host-by-email"></a>notify-host-by-email</td>
<td class="dataOdd">printf $hoststate$|mail -s Testhostminusculas2 <a href="mailto:georgyboy@gmail.com">georgyboy@gmail.com</a></td></tr>
<tr class="dataEven">
<td class="dataEven"><a name="notify-service-by-email"></a>notify-service-by-email</td>
<td class="dataEven">echo $SERVICESTATE$|mail -s Testservicesincomillas <a href="mailto:georgyboy@gmail.com">georgyboy@gmail.com</a></td></tr>
<tr class="dataOdd">
<td class="dataOdd"><a name="process-host-perfdata"></a>process-host-perfdata</td>
<td class="dataOdd">/usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out</td>
</tr>
<tr class="dataEven">
<td class="dataEven"><a name="process-service-perfdata"></a>process-service-perfdata</td>
<td class="dataEven">/usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out</td>
</tr></tbody></table></div>
<div> </div>
<div>any idea how to get all those dollar values apart of that, please?</div>
<div> </div>
<div>thanks so much!</div>
<div>jorge<br> </div>
<div><span class="gmail_quote">On 12/29/09, <b class="gmail_sendername">Martin Melin</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mmelin@gmail.com" target="_blank">mmelin@gmail.com</a>> wrote:</span>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">If your nagios.cfg sets enable_environment_macros to 0, that would be<br>the problem.<br><br>Otherwise, possibly HOSTADDRESS does not have a value for this<br>
service. Have you tried sending just $SERVICESTATE$ instead? (a<br>service notification will always have a value for the macro)<br><br>Regards<br>Martin Melin<br><br>On Tue, Dec 29, 2009 at 4:01 PM, Jorge Gil <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:georgyboy@gmail.com" target="_blank">georgyboy@gmail.com</a>> wrote:<br>
> Hi all:<br>><br>> First of all, thank you very much for your support to other users, I have<br>> gone thru hundreds of your emails, but still I couldnt find the solution to<br>> my case...<br>><br>> I have set up email notifications in nagios, and I do get emails, but I cant<br>
> make Nagios send me any information like $hostname$ in the body of the<br>> email. When I tried the typical configuration for nagios, like:<br>><br>><br>> # 'notify-service-by-email' command definition<br>
><br>> define command{<br>><br>> command_name notify-service-by-email<br>><br>> command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type:<br>> $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress:<br>
> $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:<br>> $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s<br>> "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is<br>
> $SERVICESTATE$ **" $CONTACTEMAIL$<br>><br>> }<br>><br>><br>><br>> i wasnt getting emails.<br>><br>> Now a simplified version of the command:<br>><br>><br>><br>> # 'notify-service-by-email' command definition<br>
><br>> define command{<br>><br>> command_name notify-service-by-email<br>><br>> command_line printf "%b" "$HOSTADDRESS$" | /usr/bin/mail -s Subject_of_email<br>> my_email_address<br>
><br>> }<br>><br>> does send me emails, but it doesnt translate the hostaddress, i get just a<br>> dollar sign in the body of the email.<br>><br>> I have tried to put hostaddress in small letters, with and without quotation<br>
> marks, redone all the possible files that call the alert... and I am lost.<br>><br>> What can be wrong, please? How can I make Nagios translate those variables<br>> into the actual information they contain? (for the service checks, they<br>
> actually work, I see the state change in the Nagios webserver, individually<br>> for all the hosts that I set up)<br>><br>> Thanks a lot,<br>><br>> Jorge<br>><br>> ------------------------------------------------------------------------------<br>
> This SF.Net email is sponsored by the Verizon Developer Community<br>> Take advantage of Verizon's best-in-class app development support<br>> A streamlined, 14 day to market process makes app distribution fast and easy<br>
> Join now and get one step closer to millions of Verizon customers<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://p.sf.net/sfu/verizon-dev2dev" target="_blank">http://p.sf.net/sfu/verizon-dev2dev</a><br>
> _______________________________________________<br>> Nagios-users mailing list<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br>
> <a onclick="return top.js.OpenExtLink(window,event,this)" 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<br>
> any issue.<br>> ::: Messages without supporting info will risk being sent to /dev/null<br>><br></blockquote></div><br>