Monit Not Recgonizing MYSQL PID

Discussion in 'ISPConfig 3 Priority Support' started by yupthatguy, Oct 3, 2021.

Tags:
  1. yupthatguy

    yupthatguy Member

    @till. I am working through your tutorial on Monit and Munin... everything seems to work well, except I am currently having 2 issues:

    I can't get Monit to to monitor mysql or memcached (properly).

    In your tutorial you have a note:


    So I used (and variations thereof)
    Code:
    check process mysql with pidfile /var/lib/mysql/myhostnamehere.pid
    [code]
    
    didn't work.
    
    So I did some digging and check out the documentation for monit... (cool app)
    [code]
    I used:
    # find /run -iname mysql*.pid 
    to find:
    /run/mysqld/mysqld.pid
    
    Unfortunately,
    Code:
    check process mysql with pidfile /run/mysqld/mysqld.pid
    [code]
    
    Also, doesn't work... so I am a bit befuddled on how to get monit working for mysql.  
    
    With regards to memcached.  I have memcached on both the main system and inside the jailkit. The problem is that Monit will only monit the memcached that is running inside the jailkit on the website that I use for Monit GUI. (i.e. /var/www/clients/client1/web4/var/run/memcached/memcached.pid), but if I point the monit config file at the system installation of memcached I get an error (i.e. /run/memcached/memcached.pid), saying that the path does not exist (outside of jailkit).
    
    Any tips?
     
  2. yupthatguy

    yupthatguy Member

    Hey hey... quick update. I got mysql to be monitored using
    Code:
    check process mysql with pidfile /run/mysqld/mysqld.pid
    
    Apparently, the "missing element" was a full server reboot.

    Now, the only porblem is memcahced.
     
  3. yupthatguy

    yupthatguy Member

    Ok... I solved the memcached problem...

    I pointed at the system installation not the jailkit, and then rebooted the entire server.... and it worked.
    /run/memcached/memcached.pid

    For anyone interested, apparently "#service monit reload" is sometimes insufficient for monit to recognize new configs.
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Maybe restart would work? That is, service monit restart, avoids rebooting whole server.
    Newish OS use systemd, so the commands are
    Code:
    systemctl reload monit
    systemctl restart monit
     
    ahrasis likes this.
  5. yupthatguy

    yupthatguy Member

    When I get to adding more services to monitor.. I will give those a try. thanks
     
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I normally use restart as well but I prefer the old command of service monit restart instead as it still work just fine until now even in systemd.
     

Share This Page