combin check program and check process

Issue #719 resolved
david.fazeli created an issue

I have this monit file

check process mariadb_pid with pidfile /var/lib/mysql/db1.pid

check program maria with path /root/telnet.sh
   if status = 99 then exec "/usr/bin/systemctl restart mariadb.service"
   depends on mariadb_pid

when stop mariadb i have error ! .

please look monit log:

[EST Mar  5 04:15:52] error    : 'mariadb_pid' process is not running                          
[EST Mar  5 04:15:52] info     : 'mariadb_pid' trying to restart                               
[EST Mar  5 04:15:52] error    : 'mariadb_pid' process is not running                          
[EST Mar  5 04:15:52] error    : 'mari' failed to start -- could not start required services: '
mariadb_pid'                                                                                      

Why this error occurs? i want when mariadb is failed then run my script /root/telnet.sh and depending on the script output, the mariadb will start.

Comments (3)

  1. Tildeslash repo owner

    You have to stop the service via monit in order to disable the monitoring:

    monit stop mariadb_pid
    

    otherwise if you stop the service externally, monit doesn't know the process stop was intention and restarts it.

  2. Log in to comment