You are not logged in.

#1 2013-03-21 02:49:52

luuuciano
Member
Registered: 2007-01-27
Posts: 307

Monit configuration on archlinux (mysql)

This config lines should work ok on an archlinux system?

    check process mysql with pidfile /var/run/mysqld/mysqld.pid
       group database
       start program = "/etc/rc.d/mysqld start"
       stop program = "/etc/rc.d/mysqld stop"
       if failed host 127.0.0.1 port 3306 protocol mysql then restart
       if 5 restarts within 5 cycles then timeout
       depends on mysql_bin
       depends on mysql_rc


Those "depends" lines are needed?

edit: at least the last one looks like not "Mar 20 23:01:20 localhost monit: monit: Error: Depend service 'mysql_rc' is not defined in the control file"... lol
any idea?
edit2: and the previous neither, lol "Mar 20 23:04:56 localhost monit: monit: Error: Depend service 'mysql_bin' is not defined in the control file"

edit3: without those depends it runs... then I tried killing mysqld... but it tried to restart it 5 times without luck (I have received the email alert "Description: service restarted 5 times within 5 cycles(s) - unmonitor")
sad

Last edited by luuuciano (2013-03-21 03:23:05)


I arch, you arch, he arch, she arch, we arch, they arch...

Offline

#2 2013-03-21 19:31:28

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: Monit configuration on archlinux (mysql)

Just read something about monit and arch and you'll be good wink

First, "depends" defines... well, dependencies between monit services. So in order to run mysql as shown, you have to provide these services (probably of "check file" type) or just assume they're always OK and remove dependecy check.

Then, start|stop program in your case use sysvinit style scripts, while you probably have systemd (unless you managed to avoid this monstrosity). So, replace "/etc/rc.d/mysql..." with corresponding systemctl invocation.

I don't know if mysql under systemd creates pidfile; if not, use "matching ..." or even "check host" -- as systemd takes care of process supervision, just checking connectivity will be enough.

Offline

#3 2013-03-21 19:44:42

luuuciano
Member
Registered: 2007-01-27
Posts: 307

Re: Monit configuration on archlinux (mysql)

Well, this one is a server, and for the moment is using the old rc.conf friend, no sysinit things...
That is because the lines using "/etc/rc.d/mysqld start" etc...


I arch, you arch, he arch, she arch, we arch, they arch...

Offline

#4 2013-05-15 14:44:15

[KNS]Kumo
Member
Registered: 2009-11-06
Posts: 62
Website

Re: Monit configuration on archlinux (mysql)

I have the same prroblem using monit. Most PID files gone missing and have to change every invocation by its systemctl equivalent.

Depends lines are for services you must check too. I.E. If mysqld needs mysql_rc to work, you need to check it also. Remove them to check just mysqld or whatever.

I don't know, but maybe I should try monitorix.


Ore wa Kumo Da!
http://knsweb.net

Offline

#5 2013-05-15 16:06:31

luuuciano
Member
Registered: 2007-01-27
Posts: 307

Re: Monit configuration on archlinux (mysql)

Did not know about monitorix... it looks interesting! will try it too...
Thanks for sharing

I was reading the monitorix documentation... it is like it just gatter and shows information?
It is not for restarting crashed services, etc...

Last edited by luuuciano (2013-05-15 19:34:27)


I arch, you arch, he arch, she arch, we arch, they arch...

Offline

Board footer

Powered by FluxBB