<!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">
    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 .<br>
    <br>
    <br>
    On 02/08/12 11:25, Bruno Martins wrote:
    <blockquote
cite="mid:CAASq7b2z-1+zV9NMDYPu82pknv5BszTNsQwQvDi3YufND=WhQQ@mail.gmail.com"
      type="cite">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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></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 class="moz-txt-link-freetext" href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a></pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
    <br>
  </body>
</html>