Differences
This shows you the differences between two versions of the page.
monit [2013/10/04 13:58] |
monit [2013/10/04 13:58] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Monit ====== | ||
+ | * [[Monit Examples]] | ||
+ | * [[SocketLabs]] | ||
+ | * [[dropbear]] | ||
+ | |||
+ | * [[http://mmonit.com/monit/documentation/monit.html|Documentation]] | ||
+ | |||
+ | Monit is a systems software watchdog. It will monitor services to make sure they are running, and take care of them if they get out of control. | ||
+ | ==== Monitoring Modes ==== | ||
+ | |||
+ | There are two ways for monit to operate: as active or passive. Active tries to fix problems while passive only monitors them, but sends alerts when something happens. | ||
+ | |||
+ | ==== Init ==== | ||
+ | |||
+ | * [[upstart]] | ||
+ | |||
+ | For Gentoo / CentOS, add monit to ''/etc/inittab'' and run ''telinit q'' to start the process and keep it respawning upon death. | ||
+ | |||
+ | <code> | ||
+ | # monit | ||
+ | mo:2345:respawn:/usr/bin/monit -Ic /etc/monit/monitrc | ||
+ | </code> | ||
+ | |||
+ | ==== Ubuntu ==== | ||
+ | |||
+ | For Ubuntu, create ''/etc/init/monit.conf''. Check the location of the monit binary, it may be in ''/usr/sbin'' instead of ''/usr/bin'' | ||
+ | |||
+ | <code> | ||
+ | start on runlevel [2345] | ||
+ | stop on runlevel [06] | ||
+ | exec /usr/bin/monit -Ic /etc/monit/monitrc | ||
+ | respawn | ||
+ | </code> | ||
+ | |||
+ | Add monit to the default runlevels: | ||
+ | |||
+ | <code> | ||
+ | update-rc.d monit defaults | ||
+ | service monit start | ||
+ | </code> | ||
+ | |||
+ | ==== CentOS ==== | ||
+ | |||
+ | Download and install the [[http://dev.digitaltrike.com/~steve/downloads/centos/init.d/monit|monit]] init.d script. Make sure that the ''MONIT'' variable in the script points to the correct binary. | ||
+ | |||
+ | Add monit to startup: | ||
+ | |||
+ | <code>chkconfig --levels 235 monit on</code> | ||
+ | |||
+ | ==== FreeBSD ==== | ||
+ | |||
+ | * [[FreeBSD]] | ||
+ | |||
+ | * [[http://beandog.digitaltrike.com/monit/freebsd/|monit samples]] | ||
+ | |||
+ | Add monit to startup: | ||
+ | |||
+ | <code> | ||
+ | echo monit_enable=YES >> /etc/rc.conf | ||
+ | /usr/local/etc/rc.d/monit start | ||
+ | </code> | ||
+ | |||
+ | == Todo == | ||
+ | |||
+ | * Find out how to run monit all the time. See ''man 5 ttys'' for possible reference. | ||
+ | |||
+ | ==== NetBSD ==== | ||
+ | |||
+ | * [[NetBSD]] | ||
+ | |||
+ | <code> | ||
+ | |||
+ | The following files should be created for monit-4.10.1nb2: | ||
+ | |||
+ | /etc/rc.d/monit (m=0755) | ||
+ | [/usr/pkg/share/examples/rc.d/monit] | ||
+ | </code> | ||
+ | |||
+ | ==== Outgoing Email ==== | ||
+ | |||
+ | Monit can be configured to use SocketLabs SMTP relay server to send outgoing email. SocketLabs only supports SSLv3 or no authentication: | ||
+ | |||
+ | <code> | ||
+ | set mailserver smtp.socketlabs.com username <username> password <password> | ||
+ | set mailserver smtp.socketlabs.com port 587 username <username> password <password> using SSLV3 | ||
+ | </code> |