Created
January 23, 2014 12:44
Revisions
-
corvax19 created this gist
Jan 23, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/env bash # Looks for running siebel enterprise server log file # of given system user and scans previous hour for signs of process crashes. # # 20140123 [email protected] if [ "$#" -lt 2 ]; then echo "Usage: $0 <user> <tz> [-verbose]" echo " user - system user running Siebel enterprise" echo " tz - adjusted timezone to cover previous hour (CET+0)" echo " -verbose - for verbose positive output with timestamp and used logfile name" exit 1 fi LOG=`/usr/sbin/lsof -c siebsvc|grep -e ".*$1.*\.log$"|awk '{print $(NF)}'` if [ X"$LOG" = X ]; then echo "ERROR: Siebel enterprise server's log file is not found for user $1!" exit 2 fi TS=`TZ=$2 date +"%Y-%m-%d %H:"` egrep '.*ProcessExit.*$TS.*' $LOG|grep -v SUCCESS||\ if [ "$#" -eq 3 ]; then echo "OK: $TS:xx:xx $LOG"; else echo "OK"; fi