See www.zabbix.com for the official Zabbix site.
Owner: Andris Zeila
Allow housekeeping to be scheduled externally by using Zabbix runtime process control (-R command line option) to instruct housekeeper process to start housekeeping procedure.
User must be able to start the housekeeping procedure by starting server/proxy with -R housekeeper_execute runtime control option. The housekeeper execute message was added to the runtime process control protocol (see ZBXNEXT-101 specification).
User should be able to disable the automatic housekeeping procedure by setting HousekeepingFrequency to 0 in server/proxy configuration files.
Server/proxy side changes
User signal processing
Currently user signals in Zabbix are first processed by common user signal handler (daemon.c:common_sigusr_handler()). If the signal message is not recognized (not a log level control message) the common handler calls zbx_sigusr_handler() function to process it. This function has separate implementations for agent, server and proxy.
Instead of having separate implementations of zbx_sigusr_handler() we should add an optional custom user signal handler which can be set by the processes requiring additional signal processing (configuration syncer, housekeeper).
This handler should be declared as static function pointer in daemon.c and set with zbx_set_sigusr_handler(void (*)(int flags)) function. Then instead of calling zbx_sigusr_handler() the common user signal handler should check if the custom handler is set and call it.
The HousekeepingFrequency must accept also 0 value.
Infinite sleeping support
A new function zbx_sleep_forever() must be added which would act like zbx_sleep(), with infinite sleeping interval.
Housekeeper must set custom signal handler to handle housekeeper execute signal messages.
After receiving execute signal the following additional warning message will be written in the log:
- housekeeper is sleeping - forced execution of the housekeeper
- housekeeper is already working - housekeeping procedure is already in progress
Housekeeper must use zbx_sleep_forever() instead of zbx_sleep() if HousekeepingFrequency is set to 0.
Currently housekeeper deletes data by HousekeepingFrequency * 4 time periods. It should be changed to <last sleep time> * 4 time periods where <last sleep time> is the time housekeeper slept since last housekeeping procedure. The <last sleep time> must be at least 1 hour and not more than 24 hours.
Configuration syncer changes
Configuration syncer must set custom signal handler to handle configuration cache reload signal messages.
Configuration syncer should write configuration cache reloading is already in progress if it receives configuration cache reload signal when not sleeping.