Linux‎ > ‎

swatch

Jump to: navigation, search

/etc/init.d/swatch

#! /bin/sh # chkconfig: 2345 95 20 # description: monitor of alert log of oracle for the APEX memory problem # See CSI # processname: swatch pid=`/bin/ps -ef | /bin/egrep "/usr/bin/swatch -c /etc/swatch.conf -t \
 /opt/oracle/oracle/product/10.2.0/db_1/admin/orcl1/bdump/alert_orcl1.log" | /bin/egrep -v egrep | /usr/bin/awk '{print $2}'` case "$1" in start) echo -n "Starting oracle_swatch" /usr/bin/swatch -c /etc/swatch.conf -t /opt/oracle/oracle/product/10.2.0/db_1/admin/orcl1/bdump/alert_orcl1.log --daemon & touch /var/lock/subsys/oracle_swatch echo "."  ;; stop) echo -n "Stopping oracle_swatch" if [ "${pid}" != "" ]; then /bin/kill -TERM ${pid} rm -f /var/lock/subsys/oracle_swatch echo 'Swatch System shutdown complete.' else echo ' - No Swatch System initialized.' fi echo "."  ;; *) echo "Usage: /sbin/service oracle_swatch {start|stop}" exit 1 esac exit 0

/etc/swatch.conf

ignore /ORA-1031 /
ignore /ORA-01723/
ignore /ORA-01555/
watchfor /ORA-00060/
        mail=spam@compute.info,subject=Monitoring for Oracle - ORA-0060 - Deadlock Detected in Oracle Alert Log
watchfor /ORA-/
        exec echo 'CRITICAL '`date`'' >> /var/log/oracle_alert_watch.log



Comments