You need to append "NAGIOS_" eg. NAGIOS_NOTIFICATIONTYPE. And also make sure you do "enable_environment_macros=1" in nagios.cfg<div><br></div><div><br></div><div>Ruslan<br><br><div class="gmail_quote">On Thu, Aug 2, 2012 at 12:32 PM, Assaf Flatto <span dir="ltr"><<a href="mailto:nagios@flatto.net" target="_blank">nagios@flatto.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 bgcolor="#ffffff" text="#000000">
    The marco's are internal to nagios and will not be read from an
    external text file .<br>
    <br>
    there is a way to make nagios macros available to external commands
    ( look for "macros" in the nagios.cfg file)<br>
    <br>
    But what you are trying to do with the message.txt file will fail to
    work as the SendEmail script most likely do not have access to the
    nagios internal macros and there for will not expand them .<div><div class="h5"><br>
    <br>
    <br>
    On 02/08/12 11:25, Bruno Martins wrote:
    </div></div><blockquote type="cite"><div><div class="h5">Hello list,<br>
      <br>
      How can I access Nagios variables like <span style="font-size:11pt;font-family:"Calibri","sans-serif"">$NOTIFICATIONTYPE$,
      </span><span style="font-size:11pt;font-family:"Calibri","sans-serif"">$SHORTDATETIME$,
        etc from a text file passed in a command?<br>
        <br>
        I have one command which is:<br>
        /usr/local/bin/sendEmail -o message-file=/etc/nagios/message.txt
        ... bla bla bla<br>
        <br>
        And inside message.txt I have those variables. However when I am
        notified, I am not getting variable's values, instead, it gives
        me the plain string "</span><span style="font-size:11pt;font-family:"Calibri","sans-serif"">$NOTIFICATIONTYPE$",
        etc.<br>
        <br>
        Googling didn't help too much.<br>
        <br>
        Thanks for all help on this!<br>
        <br>
        Best regards,<br>
        <br>
        Bruno<br>
      </span>
      </div></div><pre><fieldset></fieldset>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a></pre>
      <pre><fieldset></fieldset>
_______________________________________________
Nagios-users mailing list
<a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">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>
    <br>
  </div>

<br>------------------------------------------------------------------------------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today's security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</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></div>