retain status file over an init script reload
|Target version:||Icinga 1.x - 1.4.1|
|Icinga Version:||OS Version:|
even though this patch was against nagios 2.7 it could still be valid for the recent versions.
point is - event broker modules might still block the core on startup, like it happens with idoutils. but using the classic ui shouldn't be harmed by that. so the overall idea is to either make the neb module non blocking but the other one to just keep the status.dat over restart, not deleting it.
patch was done by opsview, attached.
It doesn’t delete the status file on a HUP signal. This gives the impression that Nagios is still running even though no new status information is being updated. We think this is acceptable – after all, CGIs are displaying the “latest” data, it just so happens that there is no update at this precise moment. The status file age doesn’t change, so nagiostat will show that the data is getting older, but it removes that scary screen
thing is - the cgis must check against the age of status.dat then. this can be taken out of icingastats code somehow (or check_nagios/icinga too).
i would make this behavior the default, and just allowing to disable it on demand.
#3 Updated by dnsmichi over 4 years ago
the patch is as is is already within the core. the root cause is the init script itsself.
first off, the deletion of status.dat and icinga.cmd upon start and stop is wrong, this should be handled by the daemon (detecting the sigrestart).
secondary, a sigrestart is only detected by SIGHUP which is only true for /etc/init.d/icinga reload but not restart where stop and start are invoked, but not a SIGHUP being sent. so restarting the core itsself will cause the status.dat to be deleted either way. Issueing an icinga reload will keep the file as it was suspected to be.
maybe the cgis could check for actual data age in order to reflect long lasting reloads then, but that's another story.