Tore,
Aren't you missing a $ at the end of $_HOSTCRM_SERVICES$ in your services definition?
You could also have some debugging set in Nagios to show the exact command being run.
Ton
On 24 Jun 2009, at 14:12, Tore Lønøy wrote: 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?
Ton Voon Product Architect 
Opsera Limited | Unit 69 Suttons Business Park Reading | Berkshire | RG6 1AZ | UK
Phone: +44 (0) 845 057 7887 Mobile: +44 (0) 7931 365796 Skype: tonvoon Email: ton.v...@opsera.com www.opsera.comThis 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.
|