0

I am running Monit version 5.17.1 on Ubuntu 14.04. At times, I see that Monit has logged the following:

[PST Nov 14 15:42:40] warning  : State file '/var/lib/monit/state': incompatible version 2

And after this, my services (that are monitored by Monit) restart. What can cause this to happen? Is this just file corruption ? (I have not upgraded or changed Monit version)

Let's say that this occurred, is there some way in Monit to check/correct (maybe delete and recreate state file) ?

Ani
  • 32
  • 12

1 Answers1

1

You should be able to just delete this file. It is used to store the current state of monit. Documentation states:

~/.monit.state Monit saves its state to this file and utilises information found in this file to recover from a crash. This is a binary file and its content is only of interest to monit.

So you'll loose the ability to act to the entities last state for one monit circle, but everything else should work fine. Just the SET ONREBOOT directive will stop working with LASTSTATE for one time/cycle.

boppy
  • 476
  • 2
  • 5
  • I can delete this file _after_ I see some issue, but do you suggest that this file be removed each time after a reboot? what is the version mismatch error mean ? – Ani Nov 15 '19 at 09:36
  • **No, I totally do not recommend to delete this file at all...** But since this error seems to point to any kind of corruption to this file, I think this will help you out without the loss of any data. I personally never encountered this problem while using Monit on > 20 hosts. – boppy Nov 15 '19 at 09:41