<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I think you may need to escape the backslash itself with another backslash ... vaguely recall having to do that myself in some checks when passing values that had a backslash in it.<BR>
<BR>-- <BR>Mat W. - <A href="http://www.techadre.com/">http://www.techadre.com</A><BR><BR><BR> <BR>
<HR id=stopSpelling>
Date: Wed, 24 Jun 2009 15:12:20 +0200<BR>From: tore.lonoy@gmail.com<BR>To: nagios-users@lists.sourceforge.net<BR>Subject: Re: [Nagios-users] Escaping broke i 3.1.1 ?<BR><BR>Hello,<BR><BR>Sorry for double posting, but wrong subject.<BR>
<DIV class=EC_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=EC_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=EC_gmail_quote style="PADDING-LEFT: 1ex">Date: Tue, 23 Jun 2009 19:52:07 +0100<BR>From: Ton Voon <<A>ton.voon@opsera.com</A>><BR>Subject: Re: [Nagios-users] Escaping broke i 3.1.1 ?<BR>To: Nagios Users Mailinglist <<A>nagios-users@lists.sourceforge.net</A>><BR>Message-ID: <<A>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><br /><hr />Lauren found her dream laptop. <a href='http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290' target='_new'>Find the PC that’s right for you.</a></body>
</html>