Disable any actions if service fails

Issue #334 resolved
Pavel Odintsov created an issue

Hello!

First of all, big thanks for your awesome toolkit! :)

I've pretty specific task. I'm using Monit as web management toolkit for restarting services.

So I've multiple specified services in my configuration:

 check process gobgp with MATCHING "gobgpd"
 start program = "/usr/sbin/service gobgp start"
 stop  program = "/usr/sbin/service gobgp stop"

As you can see I have no any checks.

But Monit implicitly find when my daemon fails and tried to restart it:

[MSK Mar 19 16:44:01] error    : 'nginx' process is not running
[MSK Mar 19 16:44:01] info     : 'nginx' trying to restart
[MSK Mar 19 16:44:01] info     : 'nginx' start: /etc/init.d/nginx
[MSK Mar 19 16:44:01] error    : 'gobgp' process is not running
[MSK Mar 19 16:44:01] info     : 'gobgp' trying to restart
[MSK Mar 19 16:44:01] info     : 'gobgp' start: /usr/sbin/service

I want to disable any actions in case of service fault (or will be fine if monit could detect new pid for service). Could I achieve this?

Comments (3)

  1. Pavel Odintsov reporter

    I tried to unmonitor all action from monit CLI. It's helps but after monit's restart all unmonitored services become available again.

    So for my case ability to specify "not monitored" in configuration could help.

  2. Pavel Odintsov reporter

    Looks like I've solved my issue with: mode passive for service :)

     check process gobgp with MATCHING "gobgpd"
     start program = "/usr/sbin/service gobgp start"
     stop  program = "/usr/sbin/service gobgp stop"
    mode passive
    

    It's doing what I want.

  3. Log in to comment