<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Tore,</div><div><br></div><div>Aren't you missing a $ at the end of $_HOSTCRM_SERVICES$ in your services definition?</div><div><br></div><div>See Custom variables in <a href="http://nagios.sourceforge.net/docs/3_0/macros.html">http://nagios.sourceforge.net/docs/3_0/macros.html</a></div><div><br></div><div>You could also have some debugging set in Nagios to show the exact command being run.</div><div><br></div><div>Ton</div><div><br></div><div><div>On 24 Jun 2009, at 14:12, Tore Lønøy wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello,<br><br>Sorry for double posting, but wrong subject.<br><div class="gmail_quote"><div><br>Ton:<br><br>Command line:<br>/nagios/libexec/check_nrpe -H <X> -c CheckServiceState -a AOS\$01 ShowAll=long<br>OK: AOS$01: started<br> <br>Here is the host def:<br>define host {<br> use                     X<br><br>host_name               X<br>address                 X<br>alias                   X<br><br><br>hostgroups              +CRM4<br><br>#max_check_attempts     3<br>#check_interval         2<br> #retry_interval         1<br><br>#contact_groups         +<br>#notifications_enabled  1<br><br>_CRM_SERVICES           AOS\$01<br><br># Macros<br>_REQUESTOR<br><br>}<br><br>The service definition:<br>define service {<br> # Which _template_* to use.<br> # (e.g. standard-service-60)<br>use                             standard-service-1<br><br># Service spesific<br>service_description             CRM Services<div class="im"><br>check_command                   check_nrpe_parameters!CheckServiceState!ShowAll=long $_HOSTCRM_SERVICES<br> </div> hostgroup_name                  CRM4<br><br># Per service options<br>first_notification_delay        10<br>process_perf_data               0<br>notifications_enabled           1<br>max_check_attempts      2<br>retry_interval          5<br> }<br><br>The check command definition:<br>define command {<br>        command_name check_nrpe_parameters<br>        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 15 -c $ARG1$ -a $ARG2$<br>}<br><br><br>It worked on Nagios 3.0.6. I've tried almost any combination of escaping the dollar sign, $$, \$, \\$$,\\\$.... You name it!<br> <br>Thanks for your help,<br><font color="#888888"><br>Tore<br><br> </font></div><div><div class="h5"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Date: Tue, 23 Jun 2009 19:52:07 +0100<br> From: Ton Voon <<a href="mailto:ton.voon@opsera.com" target="_blank">ton.voon@opsera.com</a>><br> Subject: Re: [Nagios-users] Escaping broke i 3.1.1 ?<br> To: Nagios Users Mailinglist <<a href="mailto:nagios-users@lists.sourceforge.net" target="_blank">nagios-users@lists.sourceforge.net</a>><br> Message-ID: <<a href="mailto:864AF918-0779-4585-885D-AFE784E69C40@opsera.com" target="_blank">864AF918-0779-4585-885D-AFE784E69C40@opsera.com</a>><br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes<br> <br> Tore,<br> <br> Can you send the configuration for the host and service too? Can you<br> also send the check_nrpe_parameters command definition.<br> <br> On the command line, what works?<br> <br> Also, you said a previous version of Nagios worked with this<br> definition - which version of Nagios was that?<br> <br> Ton<br> <br> On 23 Jun 2009, at 15:09, Tore L?n?y wrote:<br> <br> > Let me see, this should be enough i think:<br> ><br> > define host {<br> >         host_name       X<br> >         alias   X<br> >         address X<br> >         check_period    24x7<br> >         check_command   check-host-alive<br> >         contact_groups<br> >         notification_period     24x7<br> >         initial_state   o<br> >         check_interval  15.000000<br> >         retry_interval  5.000000<br> >         max_check_attempts      3<br> >         active_checks_enabled   1<br> >         passive_checks_enabled  0<br> >         obsess_over_host        1<br> >         event_handler_enabled   0<br> >         low_flap_threshold      0.000000<br> >         high_flap_threshold     0.000000<br> >         flap_detection_enabled  1<br> >         flap_detection_options  o,d,u<br> >         freshness_threshold     0<br> >         check_freshness 0<br> >         notification_options    d,r<br> >         notifications_enabled   1<br> >         notification_interval   60.000000<br> >         first_notification_delay        60.000000<br> >         stalking_options        n<br> >         process_perf_data       1<br> >         failure_prediction_enabled      1<br> >         notes_url<br> >         retain_status_information       1<br> >         retain_nonstatus_information    1<br> >         _REQUESTOR<br> >         _CRM_SERVICES   "AOS$\$01"<br> >         }<br> ><br> > define service {<br> >         host_name       X<br> >         service_description     X<br> >         check_period    24x7<br> >         check_command   check_nrpe_parameters!CheckServiceState!<br> > ShowAll=long $_HOSTCRM_SERVICES<br> >         contact_groups<br> >         notification_period     24x7<br> >         initial_state   o<br> >         check_interval  1.000000<br> >         retry_interval  5.000000<br> >         max_check_attempts      2<br> >         is_volatile     0<br> >         parallelize_check       1<br> >         active_checks_enabled   1<br> >         passive_checks_enabled  0<br> >         obsess_over_service     0<br> >         event_handler_enabled   0<br> >         low_flap_threshold      0.000000<br> >         high_flap_threshold     0.000000<br> >         flap_detection_enabled  1<br> >         flap_detection_options  o,w,u,c<br> >         freshness_threshold     0<br> >         check_freshness 0<br> >         notification_options    c,r<br> >         notifications_enabled   1<br> >         notification_interval   60.000000<br> >         first_notification_delay        10.000000<br> >         stalking_options        n<br> >         process_perf_data       0<br> >         failure_prediction_enabled      1<br> >         notes<br> >         retain_status_information       1<br> >         retain_nonstatus_information    1<br> >         }<br> ><br> > The problem for me it seems is when nagios is parsing the data just<br> > before it is going to execute the command. It is no problem executes<br> > check_nrpe with ah backslash (\) as the escape char. But the problem<br> > for me is what escape char do i use in custom macros?<br> <br> <br> <br> </blockquote></div></div></div><br> <br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Calibri; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-GB" style="font-size: 12pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">Ton Voon</span><span lang="EN-GB" style="font-size: 14pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><br></span><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">Product Architect</span><span lang="EN-GB" style="font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Times New Roman', serif; "></span><br class="Apple-interchange-newline"><span></span><span><img height="33" width="100" src="cid:image001.gif@01C923BC.C9EBFE00"></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">Opsera Limited | Unit 69 Suttons Business Park<br>Reading | Berkshire | RG6 1AZ | UK<b><br><br>Phone:   </b>+44 (0) 845 057 7887<br><b>Mobile</b></span><b><span lang="EN-GB" style="font-size: 9pt; font-family: 'Times New Roman', serif; color: rgb(74, 11, 113); ">:   </span></b><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">+44 (0) 7931 365796<br><b>Skype</b>:   tonvoon     <b>Email:</b>   <u><a href="mailto:ton.voon@opsera.com" style="color: blue; text-decoration: underline; ">ton.voon@opsera.com</a></u></span><b><span style="font-size: 10pt; font-family: Arial, sans-serif; "><br></span></b><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><a href="http://www.opsera.com/" target="_blank" title="http://www.opsera.com" style="color: blue; text-decoration: underline; "><span style="color: rgb(74, 11, 113); ">www.opsera.com</span></a><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 6pt; font-family: Arial, sans-serif; color: gray; ">This e-mail is confidential, intended only for the named recipient(s) above and may contain information that is privileged and confidential. If you receive this message in error, or are not the named recipient(s), please notify the sender at the phone number above, do not copy this message, do not disclose its contents to anyone, and delete this e-mail message from your computer. Although Opsera routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Opsera makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Opsera Limited is registered in the UK under Company Number 5396532. Our registered office is Gorse View, Horsell Rise, Woking, Surrey, GU21 4RB.</span></div></span> </div></span></div></div></div></span></span></span></span></div><br></body></html>