[SOLVED] Monit not detecting maria/mysql as existing

Discussion in 'Server Operation' started by schwim, Apr 17, 2023.

  1. schwim

    schwim Member HowtoForge Supporter

    I'm trying to use monit to monitor services on my deb 11 server but it doesn't seem to detect mysql as running.

    Code:
    check process mysql with pidfile /var/run/mysqld/mysql.pid
     group database
     start program = "/usr/sbin/service mysql start"
     stop program = "/usr/sbin/service mysql stop"
     if failed host 127.0.0.1 port 3306 then restart
     if 5 restarts within 5 cycles then timeout
    
    upload_2023-4-17_12-36-14.png
    That directory shows a pid file that hasn't been touched since Mar 9, in spite of many reboots since:
    I've done a lot of googling and it seems that it's common that a pid file isn't created by mysql or maria. Per a linux discussion on Serverfault, I added the following to my.cnf:
    Code:
    [mysqld]
    pid-file = /var/run/mysqld/mysqld.pid
    
    then restarted the mariadb and monit services. Now when I look at the modified date of the pid file, it shows as today's date. In spite of this, however, I get the same error from monit. Does not exist mysql / execution failed mysql / timeout mysql.

    What do I need to do to monitor mysql/maria on a deb 11 machine?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You missed a "d"
     
    schwim likes this.
  3. schwim

    schwim Member HowtoForge Supporter

    Well now.... that's a bit embarrassing.

    Thanks very much for your help :)
     
    ahrasis likes this.

Share This Page