#!/bin/bash #set -x file=/tmp/listner.log if [ ! -e "$file" ]; then touch /tmp/listner.log fi tail -n 0 -F /db/oraclese/product/diag/tnslsnr/pics-db11/listener/trace/listener.log | while read LINE do echo "\"host:\" "\"picsdb\", \"message:\" "\"$LINE\"" >> /tmp/listner.log if [ $? = 1 ] then echo -e "$LINE ... \n found on $HOSTNAME" | mail -s "Something's wrong on $(hostname)" bf@onb.ac.at fi done & tailf /tmp/listner.log | nc -u dlogger.onb.ac.at 12202