2

I have monit enabled and monitoring one of my applications, where if the application restarts more than 4 times in 10 cycles, I stop it, and run a script (which, among other action, also does unmonitor all, and stops monit)

Now, if I manually start my application and monit again, monit starts out with monitoring disabled on all the applications. Is it possible to say somewhere in the monitrc or other configs to monitor all on start?

I could have issued the command monit monitor all from my scripts, but there is a startup delay configured for monit, and I will have to wait until the HTTP connection is up, to issue the command. Instead it will be good to have monit start with monitoring enabled for all.

I am on the latest 5.17, built from source on Ubuntu trusty.

Ani
  • 32
  • 12

1 Answers1

0

It is not possible to specify monitor all within a configuration file, rather than issuing a unmonitor all why not just stop monit?

trozz
  • 557
  • 2
  • 12
  • No, there is no such config called `monitor all` that can be added in the `monit` config file. The reason I need to unmonitor is because of the counters - if I dont do this, the restart counters are not reset – Ani Apr 19 '16 at 07:05
  • Maybe you could try to delete the monit state file in order to reset the counter. Default monitoring mode is on, so deleting the file would remove all your unmonitor flags and counter values). Doc says : `-s statefile Write state information to this file. Or use "set statefile" in monitrc.` – DevOps Aug 03 '16 at 07:02