## ## @l_prefix@/etc/monit/monitrc - monit control file ## ## ## OPTIONS ## # daemon polling interval set daemon 120 # daemon logging target set logfile syslog # daemon remote control #set httpd # port 99 # address 127.0.0.1 # allow 127.0.0.1 # ssl disable # how to send out alert mails set alert root@localhost set mailserver 127.0.0.1 set mail-format { from: root@$HOST subject: Monit: $HOST: $SERVICE $EVENT ($ACTION) message: Date: $DATE Host: $HOST Service: $SERVICE Event: $EVENT Action: $ACTION } ## ## CHECKS ## # disk usage on root file system #check device fs-root with path / # if space usage > 90% then alert # check for OpenSSH #check process openssh # with pidfile "@l_prefix@/var/openssh/openssh.pid" # start program = "@l_prefix@/etc/openpkg rc openssh start" # stop program = "@l_prefix@/etc/openpkg rc openssh stop" # if failed host 127.0.0.1 port 22 protocol ssh then restart # if 2 restarts within 3 cycles then timeout # group server # depends on sshd_config #check file sshd_config # with path @l_prefix@/etc/openssh/sshd_config # if changed sha1 checksum then exec "@l_prefix@/etc/openpkg rc openssh stop start" # check for NTP #check process ntpd # with pidfile "@l_prefix@/var/ntp/ntpd.pid" # start program = "@l_prefix@/etc/openpkg rc ntp start" # stop program = "@l_prefix@/etc/openpkg rc ntp stop" # if failed host 127.0.0.1 port 123 type udp then restart # if 2 restarts within 3 cycles then timeout # group server # depends on ntp.conf #check file ntp.conf # with path @l_prefix@/etc/ntp/ntp.conf # if changed sha1 checksum then exec "@l_prefix@/etc/openpkg rc ntp stop start" # check for Postfix #check process postfix # with pidfile "@l_prefix@/var/postfix/pid/master.pid" # start program = "@l_prefix@/etc/openpkg rc postfix start" # stop program = "@l_prefix@/etc/openpkg rc postfix stop" # if failed host 127.0.0.1 port 25 protocol smtp then restart # if 2 restarts within 3 cycles then timeout # group server # depends on main.cf #check file main.cf # with path @l_prefix@/etc/postfix/main.cf # if changed sha1 checksum then exec "@l_prefix@/etc/openpkg rc postfix reload"