Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
— |
monit [2010/02/22 22:55] (aktuell) joe angelegt |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== monit ====== | ||
+ | monit ist ein Daemon der andere Daemons überwachen und gegebenenfalls neu starten kann, falls diese nicht mehr reagieren oder nicht mehr laufen. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | # apt-get install monit | ||
+ | |||
+ | ===== Konfiguration ===== | ||
+ | |||
+ | Die Konfiguration findet in /etc/monit/monitrc statt | ||
+ | |||
+ | set daemon 120 | ||
+ | set logfile /var/log/monit.log | ||
+ | |||
+ | check process clamd with pidfile /var/run/clamav/clamd.pid | ||
+ | start program = "/etc/init.d/clamav-daemon start" | ||
+ | stop program = "/etc/init.d/clamav-daemon stop" | ||
+ | if failed unixsocket /var/run/clamav/clamd.ctl timeout 30 seconds then restart | ||
+ | |||
+ | check process spamd with pidfile /var/run/spamd.pid | ||
+ | start program = "/etc/init.d/spamassassin start" | ||
+ | stop program = "/etc/init.d/spamassassin stop" | ||
+ | if failed unixsocket /var/run/spamd.sock timeout 30 seconds then restart | ||
+ | |||
+ | check process apache with pidfile /var/run/apache2.pid | ||
+ | start program = "/etc/init.d/apache2 start" | ||
+ | stop program = "/etc/init.d/apache2 stop" | ||
+ | if failed host 1.2.3.4 port 80 protocol http then restart | ||
+ | |||
+ | check process mysql with pidfile /var/run/mysqld/mysqld.pid | ||
+ | group database | ||
+ | start program = "/etc/init.d/mysql start" | ||
+ | stop program = "/etc/init.d/mysql stop" | ||
+ | if failed host 127.0.0.1 port 3306 then restart | ||
+ | |||
+ | check process sshd with pidfile /var/run/sshd.pid | ||
+ | start program "/etc/init.d/ssh start" | ||
+ | stop program "/etc/init.d/ssh stop" | ||
+ | if failed port 2324 protocol ssh then restart | ||
+ | |||
+ | check process exim4 with pidfile /var/run/exim4/exim.pid | ||
+ | start program = "/etc/init.d/exim4 start" | ||
+ | stop program = "/etc/init.d/exim4 stop" | ||
+ | if failed host 1.2.3.4 port 25 protocol smtp then restart | ||
+ | |||
+ | check process dovecot with pidfile /var/run/dovecot/master.pid | ||
+ | start program = "/etc/init.d/dovecot start" | ||
+ | stop program = "/etc/init.d/dovecot stop" | ||
+ | group mail | ||
+ | if failed host localhost port 993 type tcpssl sslauto protocol imap then restart | ||
+ | if failed host localhost port 143 protocol imap then restart | ||
+ | |||
+ | Im File /etc/default/monit muss noch folgende Zeile auskommentiert werden: | ||
+ | |||
+ | startup=1 | ||
+ | |||
+ | Danach wird monit mit folgendem Befehl gestartet: | ||
+ | |||
+ | /etc/init.d/monit start |