Re: [Nagios-users] Nagios retention problem.
Posted: Thu Nov 20, 2008 10:06 am
Here is a patch for xdata/xrddefault.c. This is derived from 3.0.4-code.
I hope I got the logit() call right
/Markus
256a257,258
> char errormsg[40];
> int errorcount=3D0;
274a277
>=20
561c564,570
/* If there is a problem when saving/closing the tempfile
> don't write to the retentionfile and write an error to the
> log=20
> */
> if(fclose(fp)) {
> sprintf(errormsg, "Error when closing retention
tempfile: %s", strerror(errno));
> logit(NSLOG_RUNTIME_ERROR,TRUE,errormsg,errno);
563,564c572,573
/* Remove the tempfile - I'm not sure this actually is a
good idea */
> unlink(temp_file);=20
565a575,580
> } else {
>=20
> /* move the temp file to the retention file (overwrite
the old retention file) */
> if(my_rename(temp_file,xrddefault_retention_file))
> result=3DERROR;
> }
569d583
Does anybody know if Nagios _always_ write the retention file when=20
> reloading/restarting?
> =20
It writes the retention file with rather frequent intervals, such as
when it has done "enough" checks (where "enough" is determined sort of
intelligently on a per-installation basis).
Didn't the command-file trick work for you?
--=20
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php? ... 00&url=3D/
_______________________________________________
Nagios-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/lis ... gios-devel
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: ndreas Ericsson [mailto:[email protected]
I hope I got the logit() call right
/Markus
256a257,258
> char errormsg[40];
> int errorcount=3D0;
274a277
>=20
561c564,570
/* If there is a problem when saving/closing the tempfile
> don't write to the retentionfile and write an error to the
> log=20
> */
> if(fclose(fp)) {
> sprintf(errormsg, "Error when closing retention
tempfile: %s", strerror(errno));
> logit(NSLOG_RUNTIME_ERROR,TRUE,errormsg,errno);
563,564c572,573
/* Remove the tempfile - I'm not sure this actually is a
good idea */
> unlink(temp_file);=20
565a575,580
> } else {
>=20
> /* move the temp file to the retention file (overwrite
the old retention file) */
> if(my_rename(temp_file,xrddefault_retention_file))
> result=3DERROR;
> }
569d583
Does anybody know if Nagios _always_ write the retention file when=20
> reloading/restarting?
> =20
It writes the retention file with rather frequent intervals, such as
when it has done "enough" checks (where "enough" is determined sort of
intelligently on a per-installation basis).
Didn't the command-file trick work for you?
--=20
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php? ... 00&url=3D/
_______________________________________________
Nagios-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/lis ... gios-devel
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: ndreas Ericsson [mailto:[email protected]