Werk #8295: Automatically create backup of state file if state shrinks by more than 5% in size

Component The Checkmk Micro Core
Title Automatically create backup of state file if state shrinks by more than 5% in size
Date Jul 27, 2015
Checkmk Edition Checkmk Enterprise (CEE)
Checkmk Version 1.2.7i3
Level Prominent Change
Class New Feature
Compatibility Compatible - no manual interaction needed

If you do some unlucky misconfiguration (like setting disabled services for all services instead of just a few) then you will loose the current state and downtimes of all affected objects - even if you recreate them later again. That is because from the point of view of the core vanished objects are expected to be gone forever and their state is being dropped.

In such situations the CMC now automatically creates a copy state.1 of you state file before creating a new one in its place. Previous backups are shifted to state.2, state.3 and so an. Up to 30 backups are being kept. These backup are never being restored automatically at any time. If you like to get back to your old state, you can copy these files manually:

OMD[mysite]:~$ omd stop cmc
OMD[mysite]:~$ cd var/check_mk/core
OMD[mysite]:~$ mv state state.away
OMD[mysite]:~$ cp state.1 state
OMD[mysite]:~$ omd start cmc

This backup always happens if the size of the new state file is by at least 5% smaller then the old one.

Note: The state in this file contains the current OK/WARN/CRIT, the plugin output, the next scheduled check execution, notification, downtimes, comments and stuff like that. It does not contain historic performance data or events. But these do not get lost in the cases mentioned above.

To the list of all Werks