You are not logged in.
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")
Last edited by luuuciano (2013-03-21 03:23:05)
I arch, you arch, he arch, she arch, we arch, they arch...
Offline
Just read something about monit and arch and you'll be good
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
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
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
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