[Nagios-devel] NDOutils 1.4b7 fails to run rotate_command when
Posted: Mon Sep 15, 2008 2:21 am
This is a multi-part message in MIME format.
--------------050602090301050100060909
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
Hello,
Today I noticed a bug in ndomod.c that leads ndomod to execute/process
a empty or random command instead of the defined command_line.
This happens only when using Nagios 3.x ... the corresponding log lines
looked like this :
[1221470845] Warning: Attempting to execute the command "y#," resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
The attached Patch should fix this issue.
kind Regards, Wolfgang
--
Ing. Wolfgang Powisch
System Engineer
next layer Telekommunikationsdienstleistungs- und Beratungs GmbH
tel: +43 51764 811 | fax: +43 51764 911 | web: www.nextlayer.at
my layers: Unix | Linux | HA | Mail | Web | SOAP | Softwaredesign
--------------050602090301050100060909
Content-Type: text/plain;
name="ndoutils-1.4b7-rotate_3x.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ndoutils-1.4b7-rotate_3x.patch"
--- ../../SOURCES/ndoutils-1.4b7/src/ndomod.c.1.4b7 2008-09-13 11:39:31.000000000 +0200
+++ ndoutils-1.4b7/src/ndomod.c 2008-09-15 11:37:48.000000000 +0200
@@ -591,20 +591,25 @@
/* get the raw command line */
#ifdef BUILD_NAGIOS_2X
get_raw_command_line(ndomod_sink_rotation_command,raw_command_line,sizeof(raw_command_line),STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ strip(raw_command_line);
#else
get_raw_command_line(find_command(ndomod_sink_rotation_command),ndomod_sink_rotation_command,&raw_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ strip(raw_command_line_3x);
#endif
- strip(raw_command_line);
/* process any macros in the raw command line */
#ifdef BUILD_NAGIOS_2X
process_macros(raw_command_line,processed_command_line,(int)sizeof(processed_command_line),STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
#else
- process_macros(raw_command_line,&processed_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ process_macros(raw_command_line_3x,&processed_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
#endif
/* run the command */
+#ifdef BUILD_NAGIOS_2X
my_system(processed_command_line,ndomod_sink_rotation_timeout,&early_timeout,&exectime,NULL,0);
+#else
+ my_system(processed_command_line_3x,ndomod_sink_rotation_timeout,&early_timeout,&exectime,NULL,0);
+#endif
/* allow data to be written to the sink */
--------------050602090301050100060909--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------050602090301050100060909
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
Hello,
Today I noticed a bug in ndomod.c that leads ndomod to execute/process
a empty or random command instead of the defined command_line.
This happens only when using Nagios 3.x ... the corresponding log lines
looked like this :
[1221470845] Warning: Attempting to execute the command "y#," resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
The attached Patch should fix this issue.
kind Regards, Wolfgang
--
Ing. Wolfgang Powisch
System Engineer
next layer Telekommunikationsdienstleistungs- und Beratungs GmbH
tel: +43 51764 811 | fax: +43 51764 911 | web: www.nextlayer.at
my layers: Unix | Linux | HA | Mail | Web | SOAP | Softwaredesign
--------------050602090301050100060909
Content-Type: text/plain;
name="ndoutils-1.4b7-rotate_3x.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ndoutils-1.4b7-rotate_3x.patch"
--- ../../SOURCES/ndoutils-1.4b7/src/ndomod.c.1.4b7 2008-09-13 11:39:31.000000000 +0200
+++ ndoutils-1.4b7/src/ndomod.c 2008-09-15 11:37:48.000000000 +0200
@@ -591,20 +591,25 @@
/* get the raw command line */
#ifdef BUILD_NAGIOS_2X
get_raw_command_line(ndomod_sink_rotation_command,raw_command_line,sizeof(raw_command_line),STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ strip(raw_command_line);
#else
get_raw_command_line(find_command(ndomod_sink_rotation_command),ndomod_sink_rotation_command,&raw_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ strip(raw_command_line_3x);
#endif
- strip(raw_command_line);
/* process any macros in the raw command line */
#ifdef BUILD_NAGIOS_2X
process_macros(raw_command_line,processed_command_line,(int)sizeof(processed_command_line),STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
#else
- process_macros(raw_command_line,&processed_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
+ process_macros(raw_command_line_3x,&processed_command_line_3x,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);
#endif
/* run the command */
+#ifdef BUILD_NAGIOS_2X
my_system(processed_command_line,ndomod_sink_rotation_timeout,&early_timeout,&exectime,NULL,0);
+#else
+ my_system(processed_command_line_3x,ndomod_sink_rotation_timeout,&early_timeout,&exectime,NULL,0);
+#endif
/* allow data to be written to the sink */
--------------050602090301050100060909--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]