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.
--
Mat W. - http://www.techadre.com
Date: Wed, 24 Jun 2009 15:12:20 +0200
From: tore.lo...@gmail.com
To: nagios-users@lists.sourceforge.net
Subject: Re: [Nagios-users] Escaping broke i 3.1.1 ?
Hello,
Sorry for double posting, but wrong subject.
Ton:
Command line:
/nagios/libexec/check_nrpe -H <X> -c CheckServiceState -a AOS\$01 ShowAll=long
OK: AOS$01: started
Here is the host def:
define host {
use X
host_name X
address X
alias X
hostgroups +CRM4
#max_check_attempts 3
#check_interval 2
#retry_interval 1
#contact_groups +
#notifications_enabled 1
_CRM_SERVICES AOS\$01
# Macros
_REQUESTOR
}
The service definition:
define service {
# Which _template_* to use.
# (e.g. standard-service-60)
use standard-service-1
# Service spesific
service_description CRM Services
check_command
check_nrpe_parameters!CheckServiceState!ShowAll=long $_HOSTCRM_SERVICES
hostgroup_name CRM4
# Per service options
first_notification_delay 10
process_perf_data 0
notifications_enabled 1
max_check_attempts 2
retry_interval 5
}
The check command definition:
define command {
command_name check_nrpe_parameters
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 15 -c $ARG1$ -a
$ARG2$
}
It worked on Nagios 3.0.6. I've tried almost any combination of escaping the
dollar sign, $$, \$, \\$$,\\\$.... You name it!
Thanks for your help,
Tore
Date: Tue, 23 Jun 2009 19:52:07 +0100
From: Ton Voon <ton.v...@opsera.com>
Subject: Re: [Nagios-users] Escaping broke i 3.1.1 ?
To: Nagios Users Mailinglist <nagios-users@lists.sourceforge.net>
Message-ID: <864af918-0779-4585-885d-afe784e69...@opsera.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Tore,
Can you send the configuration for the host and service too? Can you
also send the check_nrpe_parameters command definition.
On the command line, what works?
Also, you said a previous version of Nagios worked with this
definition - which version of Nagios was that?
Ton
On 23 Jun 2009, at 15:09, Tore L?n?y wrote:
> Let me see, this should be enough i think:
>
> define host {
> host_name X
> alias X
> address X
> check_period 24x7
> check_command check-host-alive
> contact_groups
> notification_period 24x7
> initial_state o
> check_interval 15.000000
> retry_interval 5.000000
> max_check_attempts 3
> active_checks_enabled 1
> passive_checks_enabled 0
> obsess_over_host 1
> event_handler_enabled 0
> low_flap_threshold 0.000000
> high_flap_threshold 0.000000
> flap_detection_enabled 1
> flap_detection_options o,d,u
> freshness_threshold 0
> check_freshness 0
> notification_options d,r
> notifications_enabled 1
> notification_interval 60.000000
> first_notification_delay 60.000000
> stalking_options n
> process_perf_data 1
> failure_prediction_enabled 1
> notes_url
> retain_status_information 1
> retain_nonstatus_information 1
> _REQUESTOR
> _CRM_SERVICES "AOS$\$01"
> }
>
> define service {
> host_name X
> service_description X
> check_period 24x7
> check_command check_nrpe_parameters!CheckServiceState!
> ShowAll=long $_HOSTCRM_SERVICES
> contact_groups
> notification_period 24x7
> initial_state o
> check_interval 1.000000
> retry_interval 5.000000
> max_check_attempts 2
> is_volatile 0
> parallelize_check 1
> active_checks_enabled 1
> passive_checks_enabled 0
> obsess_over_service 0
> event_handler_enabled 0
> low_flap_threshold 0.000000
> high_flap_threshold 0.000000
> flap_detection_enabled 1
> flap_detection_options o,w,u,c
> freshness_threshold 0
> check_freshness 0
> notification_options c,r
> notifications_enabled 1
> notification_interval 60.000000
> first_notification_delay 10.000000
> stalking_options n
> process_perf_data 0
> failure_prediction_enabled 1
> notes
> retain_status_information 1
> retain_nonstatus_information 1
> }
>
> The problem for me it seems is when nagios is parsing the data just
> before it is going to execute the command. It is no problem executes
> check_nrpe with ah backslash (\) as the escape char. But the problem
> for me is what escape char do i use in custom macros?
_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
------------------------------------------------------------------------------
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.
::: Messages without supporting info will risk being sent to /dev/null