<!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 text="#000000" bgcolor="#ffffff">
    On 29/09/10 18:00, Lori Adams wrote:
    <blockquote
cite="mid:B6ACB182127B1F45BCE974C88D4117BF132B89641C@EXCH-C2.corp.cloudmark.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size: 10pt;">I’m having a
            terrible
            time setting up nrpe to allow me to pass a string with
            spaces.  This is with
            nagios 3.x and nrpe 2.0.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">The service
            config is trying
            to check a log on a remote server for a string that contains
            spaces.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">The service
            block has the
            check_command set to:<br>
            check_command                  
            check_log_perl_nofilter_test!/srv/logs/spamnet/log-parser/log-parser.log!/srv/nagios_nrpe/tmp/log-parser.log.out!\"ERROR:
Parent:
            Fatal error\"<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">The
            check_command is set to:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">define
            command {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">       
            command_name   
            check_log_perl_nofilter_test<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">       
            command_line   
            $USER2$/check_nrpe -u -t 30 -H $HOSTADDRESS$ -c
            check_log_perl_nofilter -a
            $ARG1$ $ARG2$ "$ARG3$"<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">The nrpe
            config is then:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">command[check_log_perl_nofilter]=
/srv/nagios_nrpe/scripts/check_log.pl
            --filename=$ARG1$ --oldlog=$ARG2$
            --query=$ARG3$<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">If I change
            the nrpe config
            to echo the command, so that it looks like:<br>
                            command[check_log_perl_nofilter]= echo
            /srv/nagios_nrpe/scripts/check_log.pl
            --filename=$ARG1$ --oldlog=$ARG2$ --query=$ARG3$<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Then, the
            output of the echo
            is:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">/srv/nagios_nrpe/scripts/check_log.pl
--filename=/srv/logs/spamnet/log-parser/log-parser.log
--oldlog=/srv/nagios_nrpe/tmp/log-parser.log.out
            --query=ERROR:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">I’ve tried
            quoting the
            $ARG3$ in the nrpe command, and I get the same thing. <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">I’ve seed
            other threads
            on the list that in order to pass quotes to nrpe, you must
            escape them.  You
            can see I’ve tried that.   Any guidance would be extremely
            helpful.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">               
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Thanks,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Lori Adams<o:p></o:p></span></p>
        <br>
      </div>
    </blockquote>
    Have you compiled nrpe with the allow command <em>arguments ?<br>
      <br>
      to get the proper syntax do ./configure --help<br>
      <br>
      <br>
    </em>
    <pre class="moz-signature" cols="72">-- 
Never,Ever Cut A Deal With a Dragon 


Next year I will be doing the London to Paris bike ride to 
raise money for the DogTrust (<a class="moz-txt-link-abbreviated" href="http://www.dogstrust.co.uk">www.dogstrust.co.uk</a>) .
Please Sponsor me at <a class="moz-txt-link-freetext" href="http://www.justgiving.com/Assaf-Flatto">http://www.justgiving.com/Assaf-Flatto</a></pre>
  </body>
</html>