Re: [Nagios-devel] 2 calls to unlink in checkresults

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] 2 calls to unlink in checkresults

Post by Guest »

On Wed, 13 May 2009 17:47:06 -0400, Mathieu Gagné
wrote:

>Hi,
>
>I did a strace on the Nagios daemon and found out there's 2 calls to
>unlink for each check result file in checkresults.

I believe they're only temporary files to contact results from a
specific check.

>For example:
>
>stat64("/usr/local/nagios/var/spool/checkresults/cXKYnMY",
>{st_mode=S_IFREG|0600, st_size=475, ...}) = 0
>stat64("/usr/local/nagios/var/spool/checkresults/cXKYnMY.ok",
>{st_mode=S_IFREG|0600, st_size=0, ...}) = 0
>time(NULL) = 1242249182
>open("/usr/local/nagios/var/spool/checkresults/cXKYnMY", O_RDONLY) = 7
>fstat64(7, {st_mode=S_IFREG|0600, st_size=475, ...}) = 0
>mmap2(NULL, 475, PROT_READ, MAP_PRIVATE, 7, 0) = 0xb7ee8000
>munmap(0xb7ee8000, 475) = 0
>close(7) = 0
>unlink("/usr/local/nagios/var/spool/checkresults/cXKYnMY") = 0
>unlink("/usr/local/nagios/var/spool/checkresults/cXKYnMY.ok") = 0
>
>[......]
>
>unlink("/usr/local/nagios/var/spool/checkresults/cXKYnMY") = -1 ENOENT
>(No such file or directory)
>unlink("/usr/local/nagios/var/spool/checkresults/cXKYnMY.ok") = -1
>ENOENT (No such file or directory)
>
>
>Any idea about the source of this problem? (if it's one)

Are you seeing a problem? It's supposed to unlink them I believe. See
base/utils.c delete_check_result_file, I believe that's probably where
you're seeing the two unlink calls come from.

--
Jonathan Angliss







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