Created
January 23, 2014 12:44
-
-
Save corvax19/8577932 to your computer and use it in GitHub Desktop.
Looks for running siebel enterprise server log file of given system user and scans previous hour for signs of process crashes.
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 characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment