<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hari Sekhon wrote:
<blockquote cite="mid44ABC06A.20403@gmail.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Rimbert Rivera wrote:
  <blockquote
 cite="midE1F190DAC247C64FAA46B38316FA151D04498DBF@EX-101.mail.navisite.com"
 type="cite">
    <title>Is there a way to include the result of check_nagios in the
subject line of an e-mail?</title>
    <meta http-equiv="Content-Type" content="text/html; ">
    <meta content="MSHTML 6.00.2900.2912" name="GENERATOR">
    <div dir="ltr" align="left"><span class="069222913-05072006"><font
 color="#0000ff" face="Arial" size="2">It's piping the command to mail.</font></span></div>
    <div dir="ltr" align="left"><span class="069222913-05072006"></span> </div>
    <div dir="ltr" align="left"><span class="069222913-05072006"><font
 color="#0000ff" face="Arial" size="2">This is the check command:</font></span></div>
    <div dir="ltr" align="left"><span class="069222913-05072006"><font
 face="Arial" size="2">/usr/local/nagios/libexec/check_nagios -F
/usr/local/nagios/var/status.log -e 5 -C /usr/local/nagios/bin/nagios</font></span></div>
    <div dir="ltr" align="left"><span class="069222913-05072006"></span> </div>
    <div dir="ltr" align="left"><span class="069222913-05072006"><font
 face="Arial" size="2">This is the mail command:</font></span></div>
    <div dir="ltr" align="left"><span class="069222913-05072006"><font
 color="#0000ff"><font color="#000000" face="Arial" size="2">mail
-s"Nagios Status check (heartbeat)" </font><a
 class="moz-txt-link-abbreviated" href="mailto:email@domain.com"><font
 face="Arial" size="2">email@domain.com</font></a> </font>
    <div><font color="#0000ff"> </font></div>
    <div><span class="069222913-05072006"><font color="#0000ff"><font
 face="Arial" size="2">So I'm using the pipe command, "|", to redirect
the output of the check to mail</font></font></span></div>
    <div><span class="069222913-05072006"></span> </div>
    <div><span class="069222913-05072006"><font face="Arial" size="2">Full
command:</font></span></div>
    <div><span class="069222913-05072006"><font face="Arial" size="2">/usr/local/nagios/libexec/check_nagios
-F /usr/local/nagios/var/status.log -e 5 -C
/usr/local/nagios/bin/nagios | mail -s"Nagios Status check (heartbeat)"
    <a class="moz-txt-link-abbreviated" href="mailto:email@domain.com">email@domain.com</a></font></span></div>
    </span></div>
    <div> </div>
<!-- Converted from text/rtf format --><br>
    <p><font color="#808000" face="Arial">- Rim</font> </p>
    <p><font color="#808000" face="Arial">Rimbert Rivera</font> <br>
    <font color="#808000" face="Arial">Manager, Information Technology</font>
    <br>
    <font color="#808000" face="Arial">COMTEX News Network</font> <br>
    <font color="#808000" face="Arial"><a
 class="moz-txt-link-abbreviated" href="mailto:rrivera@comtex.com">rrivera@comtex.com</a></font>
    <br>
    <font color="#808000" face="Arial">(703) 820-2000</font> <br>
    <font color="#808000" face="Arial">Discover more about COMTEX at: <a
 href="http://www.comtex.com/">http://www.comtex.com/</a></font> <br>
    <font color="#808000" face="Arial">This e-mail is intended solely
for
the person or entity to which it is addressed and may contain
confidential and/or privileged information. Any review, dissemination,
copying, printing or other use of this e-mail by persons or entities
other than the addressee is prohibited. If you have received this
e-mail in error, please contact the sender immediately and delete the
material from any computer.</font></p>
    <div> </div>
    <br>
    <div class="OutlookMessageHeader" dir="ltr" align="left"
 lang="en-us">
    <hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Hari
Sekhon [<a class="moz-txt-link-freetext"
 href="mailto:harisekhon@gmail.com">mailto:harisekhon@gmail.com</a>] <br>
    <b>Sent:</b> Wednesday, July 05, 2006 9:25 AM<br>
    <b>To:</b> Rimbert Rivera<br>
    <b>Subject:</b> Re: [Nagios-users] Is there a way to include the
result of check_nagios in the subject line of an e-mail?<br>
    </font><br>
    </div>
Rimbert Rivera wrote:
    <blockquote
 cite="midE1F190DAC247C64FAA46B38316FA151D04498DB5@EX-101.mail.navisite.com"
 type="cite">
      <meta content="MS Exchange Server version 6.5.7638.1"
 name="Generator">
<!-- Converted from text/rtf format -->
      <p><font face="Arial" size="2">I have a Cron job running every
two
hours that runs check_nagios and e-mails us the result.  Here's the
command I'm using:</font></p>
      <p><font face="Arial" size="2">/usr/local/nagios/libexec/check_nagios
-F /usr/local/nagios/var/status.log -e 5 -C
/usr/local/nagios/bin/nagios | mail -s"Nagios Status check (heartbeat)"
      <a class="moz-txt-link-abbreviated" href="mailto:email@domain.com">email@domain.com</a></font></p>
      <p><font face="Arial" size="2">The command e-mails the
check_nagios
output as the e-mail body.  Is there a way to put it in the subject
line instead?  I cannot figure it out.  I don't think mail will let me
do what I want.  Is there something else I can use?  I'm using RedHat 9.</font></p>
      <p><font color="#808000" face="Arial">- Rim</font> </p>
      <p><font color="#808000" face="Arial">Rimbert Rivera</font> <br>
      <font color="#808000" face="Arial">Manager, Information Technology</font>
      <br>
      <font color="#808000" face="Arial">COMTEX News Network</font> <br>
      <font color="#808000" face="Arial"><a
 class="moz-txt-link-abbreviated" href="mailto:rrivera@comtex.com">rrivera@comtex.com</a></font>
      <br>
      <font color="#808000" face="Arial">(703) 820-2000</font> <br>
      <font color="#808000" face="Arial">Discover more about COMTEX at:
      </font><a href="http://www.comtex.com/"><u><font color="#0000ff"
 face="Arial">http://www.comtex.com/</font></u></a> <br>
      <font color="#808000" face="Arial">This e-mail is intended solely
for the person or entity to which it is addressed and may contain
confidential and/or privileged information. Any review, dissemination,
copying, printing or other use of this e-mail by persons or entities
other than the addressee is prohibited. If you have received this
e-mail in error, please contact the sender immediately and delete the
material from any computer.</font></p>
      <pre wrap=""><hr size="4" width="90%">
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
<a class="moz-txt-link-freetext"
 href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a></pre>
      <pre wrap=""><hr size="4" width="90%">
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated"
 href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext"
 href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre>
    </blockquote>
how are you sending the emails?<br>
    <br>
    <br>
  </blockquote>
this works for me:<br>
  <br>
/usr/nagios/libexec/check_nagios -F /var/nagios/status.log -e 5 -C
/usr/nagios/bin/nagios > nagtest.txt<br>
mail -s "`cat nagtest.txt`" <a class="moz-txt-link-abbreviated"
 href="mailto:me@mydomain.com">me@mydomain.com</a> < /dev/null<br>
  <br>
-h<br>
  <br>
  <br>
</blockquote>
sorry forgot to send these to the list...<br>
</body>
</html>