Hey there... no one's done anything with this in a while, but I figured I would post my working monitor script. The one thing to note is that the purpose of the script is NOT to restart a failed process, simply to give the administrator a heads up that something is about to go bad (Eg. process hung, running out of resources, process died... etc).
Code:
check system myhost.local
if loadavg (1min) > 4 then alert
if loadavg (5min) > 2 then alert
if memory usage > 85% then alert
if cpu usage (user) > 70% then alert
if cpu usage (system) > 50% then alert
if cpu usage (wait) > 20% then alert
check process Zimbra.Apache
with pidfile "/opt/zimbra/log/httpd.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
if failed port 80 protocol http then alert
group zimbra
check process Zimbra.Logwatch
with pidfile "/opt/zimbra/log/logswatch.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
check process Zimbra.MySQL
with pidfile "/opt/zimbra/db/mysql.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
if failed port 7306 protocol mysql then alert
group zimbra
check process Zimbra.MySQL_Logger
with pidfile "/opt/zimbra/logger/db/mysql.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
depends on Zimbra.MySQL
group zimbra
check process Zimbra.MTA_Config
with pidfile "/opt/zimbra/log/zmmtaconfig.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
check process Zimbra.Mailbox_Java
with pidfile "/opt/zimbra/log/zmmailboxd_java.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
if failed port 143 protocol imap then alert
group zimbra
check process Zimbra.Mailbox_Control
with pidfile "/opt/zimbra/log/zmmailboxd_manager.pid"
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
check process Zimbra.ClamAV
with pidfile /opt/zimbra/log/clamd.pid
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
check process Zimbra.Cyrus_SASL
with pidfile /opt/zimbra/cyrus-sasl/state/saslauthd.pid
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
check process Zimbra.Postfix
with pidfile /opt/zimbra/data/postfix/spool/pid/master.pid
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
if failed port 25 protocol smtp then alert
group zimbra
check process Zimbra.LDAP
with pidfile /opt/zimbra/openldap/var/run/slapd.pid
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
if failed host myhost.local port 389 protocol ldap3 then alert
group zimbra
check process Zimrba.Amavis
with pidfile /opt/zimbra/log/amavisd.pid
if children > 255 for 5 cycles then alert
if cpu usage > 95% for 3 cycles then alert
group zimbra
So, think of this as an early warning system. Monit can easily be set to use a different SMTP server than your Zimbra server, so it gets around that problem as well.