# # $Id: monitrc.alt,v 1.3 2004/02/12 20:47:56 homyakov Exp $ # set daemon 120 set logfile syslog set mailserver localhost #short, informative messages #set mail-format { # from: monit@myhostname.com # subject: [monit] -- $PROGRAM $EVENT on $HOST at $DATE # message: #} #set httpd port 2812 and use the address localhost # allow localhost # allow monit:secretword # ssl enable # pemfile /var/lib/ssl/certs/monit.pem #check named with pidfile /var/run/named.pid # start program = "/etc/init.d/bind start" # stop program = "/etc/init.d/bind stop" # if failed host localhost port 53 use type udp then restart # if 5 restarts with 5 cycles then timeout # alert hostmaster@myhostname.com # group servers #check master with pidfile /var/spool/postfix/pid/master.pid # start program = "/etc/init.d/postfix start" # stop program = "/etc/init.d/postfix stop" # if failed host localhost port 25 with proto smtp then restart # alert postmaster@myhostname.com # group mail #check drwebd with pidfile /var/spool/drweb/run/drwebd.pid # start program = "/etc/init.d/drwebd start" # stop program = "/etc/init.d/drwebd stop" # if failed unix /var/spool/drweb/run/drweb.sock then restart # if memkbyte > 10000 for 5 cycles then restart # if 5 restarts with 5 cycles then timeout # alert postmaster@myhostname.com # group mail #check sshd with pidfile /var/run/sshd.pid # start program = "/etc/init.d/sshd start" # stop program = "/etc/init.d/sshd stop" # if failed host localhost port 22 with proto ssh then restart # alert admin@myhostname.com # group servers #check squid with pidfile /var/run/squid.pid # start program = "/etc/init.d/squid start" # stop program = "/etc/init.d/squid stop" # if failed host localhost port 3128 use type tcp then restart # alert proxymaster@myhostname.com # group servers # Don't forget to add '-pidfile /var/run/xinetd.pid' to EXTRAOPTIONS variable # in /etc/sysconfig/xinetd file # #check xinetd with pidfile /var/run/xinetd.pid # start program = "/etc/init.d/xinetd start" # stop program = "/etc/init.d/xinetd stop" # if failed host localhost port 21 with proto ftp then restart # if failed host localhost port 110 with proto pop then restart # alert admin@myhostname.com # group servers # Don't forget to add '-p /var/run/ntpd.pid' to NTPD_OPTIONS variable # in /etc/sysconfig/ntpd file #check ntpd with pidfile /var/run/ntpd.pid # start program = "/etc/init.d/ntpd start" # stop program = "/etc/init.d/ntpd stop" # alert admin@myhostname.com # group servers #check klogd with pidfile /var/run/klogd.pid # start program = "/etc/init.d/klogd start" # stop program = "/etc/init.d/klogd stop" # alert admin@myhostname.com # group system #check syslogd with pidfile /var/run/syslogd.pid # start program = "/etc/init.d/syslogd start" # stop program = "/etc/init.d/syslogd stop" # alert admin@myhostname.com # group system # depends on syslog_file #check file syslog_file messages with path /var/log/messages # if timestamp > 65 minutes then alert #check crond with pidfile /var/run/crond.pid # start program = "/etc/init.d/crond start" # stop program = "/etc/init.d/crond stop" # alert admin@myhostname.com # group system #check atd with pidfile /var/run/atd.pid # start program = "/etc/init.d/atd start" # stop program = "/etc/init.d/atd stop" # alert admin@myhostname.com # group system