Nagios Bug and Feature Tracker
Bug and Feature Tracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000332 [Nagios Core] Checks major always 2012-05-08 21:17 2012-05-14 05:40
Reporter eschoeller View Status public  
Assigned To estanley
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0000332: Double quotes in check_command definition break functionality
Description We upgraded one of our nagios core environments today from v3.3.1 to 3.4.0 and started to experience large scale instability in many of our service checks. The symptoms varied between the various plugins but some example output:

"Name or service not known"
"No data was received from host!"
"libexec/check_nrpe: invalid option -- w"

Many of the plugins that functioned perfectly in a v3.3.1 environment were completely broken in v3.4.0

We eventually determined that we had been using double quotes in many of these check_command definitions, such as:

check_https!"HTTP/1."!"443"!/

or similar.

We found switching all of these double quotes to single quotes (or removing them entirely where unnecessary) solved all of the strange problems. If double quotes are now interpreted differently or not supported, a check of the configuration should indicate a problem !
Additional Information We are continuing to monitor the performance of this infrastructure, but since the upgrade (and config fix) we are seeing a very distinct change in the frequency of service checks being executed.
Tags No tags attached.
Nagios Version 3.4.0
OS RHEL
OS Version 4
Attached Files ? file icon checks.diff [^] (696 bytes) 2012-05-13 15:27

- Relationships

-  Notes
(0000423)
whaity (reporter)
2012-05-09 10:24

I have the same issue.
CentOS 6.2, Nagios 3.3.1 -> Nagios 3.4 upgrade. All work fine before.
The only plug in I have that uses double quotes is the check_snmp_printer plug in.
I have tested the command version and all works fine.
If I run via Nagios I get a "Invalid check specified by -x parameter."
I have tried single quotes but I get them same problem it seems.
(0000424)
prandal (reporter)
2012-05-09 12:31

It also breaks check_mk because of its use of definitions like this:

# Calling check_mk with precompiled checks
define command {
  command_name check-mk
  command_line python /var/lib/check_mk/precompiled/"$HOSTNAME$"
}
(0000425)
tolim (reporter)
2012-05-09 12:59

It broke check_http and check_by_ssh here among other things..same symptoms.
(0000426)
jangs (reporter)
2012-05-09 23:36

Same error for check_by_ssh command
/usr/local/nagios/libexec/check_by_ssh: invalid option -- 'w'

Nagios 3.3.1 -> Nagios 3.4 upgrade
OS: Debian
OS Version: 6.0.4
(0000427)
prandal (reporter)
2012-05-13 14:42
edited on: 2012-05-13 16:32

In checks.c, replacing

if(!strpbrk(processed_command,"!$^&*()~[]|{};<>?`")){

with

if(!strpbrk(processed_command,"!$^&*()~[]|{};<>?`\\'\"")){

fixes this issue.

An appropriate char *temp_buffer declaration in the embedded perl compile path is also needed if checks.c is to compile with the embedded perl option turned on.

Attached checks.diff fixes the issue.

(0000428)
estanley (administrator)
2012-05-14 05:40

Reverted patch that caused the problem (issue 0000086)

- Issue History
Date Modified Username Field Change
2012-05-08 21:17 eschoeller New Issue
2012-05-08 21:17 eschoeller Nagios Version => 3.4.0
2012-05-08 21:17 eschoeller OS => RHEL
2012-05-08 21:17 eschoeller OS Version => 4
2012-05-09 09:57 whaity Issue Monitored: whaity
2012-05-09 10:24 whaity Note Added: 0000423
2012-05-09 12:31 prandal Note Added: 0000424
2012-05-09 12:59 tolim Note Added: 0000425
2012-05-09 23:36 jangs Note Added: 0000426
2012-05-10 02:34 bfek18 Issue Monitored: bfek18
2012-05-10 14:49 ondrag Issue Monitored: ondrag
2012-05-13 14:42 prandal Note Added: 0000427
2012-05-13 15:27 prandal File Added: checks.diff
2012-05-13 15:27 prandal Note Edited: 0000427
2012-05-13 16:32 prandal Note Edited: 0000427
2012-05-14 05:37 estanley Status new => assigned
2012-05-14 05:37 estanley Assigned To => estanley
2012-05-14 05:40 estanley Note Added: 0000428
2012-05-14 05:40 estanley Status assigned => resolved
2012-05-14 05:40 estanley Resolution open => fixed
2012-07-18 13:59 PMDubuc Issue Monitored: PMDubuc


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker