Re: [Nagios-devel] process_check_result_file does not delete files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] process_check_result_file does not delete files

Post by Guest »

This is a multi-part message in MIME format.
--------------070101000809040209060507
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Please drop last patch... didn't read the man open right... sorry for that.

After cleaning up the checkresult dir nagios creates all needed files
(cXXXXXX + cXXXXXX.ok) properly.

@florian

can you please have a look at your checkresult spool dir and tell us if
there is a *.ok file for each cXXXXXX file?

In case that not please try this patch to get an error message to logs
and console to determine why nagios could not create that ok file.

Regards,
Hendrik

--------------070101000809040209060507
Content-Type: text/x-patch;
name="utils.c.debug.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="utils.c.debug.patch"

Index: base/utils.c
===================================================================
RCS file: /cvsroot/nagios/nagios/base/utils.c,v
retrieving revision 1.180
diff -u -r1.180 utils.c
--- base/utils.c 9 Jun 2007 16:43:03 -0000 1.180
+++ base/utils.c 18 Jun 2007 16:05:00 -0000
@@ -4185,8 +4185,13 @@

/* create an ok-to-go indicator file */
asprintf(&temp_buffer,"%s.ok",output_file);
- if((output_file_fd=open(temp_buffer,O_CREAT|O_WRONLY|O_TRUNC,S_IRUSR|S_IWUSR))>0)
+ if((output_file_fd=open(temp_buffer,O_CREAT|O_WRONLY|O_TRUNC,S_IRUSR|S_IWUSR))>0){
close(output_file_fd);
+ }
+ else{
+ asprintf(&temp_buffer,"Error: Could not create ok file for %s: %d --%s--.\n",output_file,errno,strerror(errno));
+ write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_ERROR,TRUE);
+ }
my_free((void **)&temp_buffer);

/* delete the original file */

--------------070101000809040209060507--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked