Here goes. I use snmp to keep an eye on the acceptable values for loadavg since I systematically use cricket and nagios to graph such stuff on all systems I'm supporting.

----------------------------------------------------------------------
#!/bin/sh

MAILTO="[EMAIL PROTECTED]"
WHEREAMI=`hostname`

get_snmp() {
    /usr/bin/snmpget -Ovq -v 1 -c public localhost "$1"
}

send_alert() {
        mail -s "[${WHEREAMI}:$1]" $MAILTO </dev/null
}

check_load() {
    # trigger error when 15min too high
    # and neither 1min nor 5min below threshold
    avg=`get_snmp "laErrorFlag.1"`
    [ "$avg" = "0" ] && return 0
    avg=`get_snmp "laErrorFlag.2"`
    [ "$avg" = "0" ] && return 0
    avg=`get_snmp "laErrorFlag.3"`
    return $avg
}

restart_dbmail() {
        send_alert "DbmailRestartAlert"
        /etc/init.d/dbmail restart
}


check_load || restart_dbmail
-----------------------------------------------------------------


ocl wrote:
I do run 2.0.1 in production, but not without running a cronjob which checks the load on a machine, and restarts dbmail when the load becomes excessive.


Could you please post a copy of this cron script.

It sounds like a good idea for all seasons.

Cheers,
Ray

_______________________________________________
Dbmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail



--
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to