Viewing 1 to 4 of 4 items
Tag Archives: Match

This script checks the log file for timeouts

Code: #!/bin/ksh ################################################################################################## # # This script checks the log file for timeouts # ################################################################################################## TIMEOUT=`tail -5000 /dir1/logs/logfile.log | grep “has timed out and is not currently tradeable” | tail -1`; echo ${TIMEOUT}; if [ ! -z ${TIMEOUT} ]; then echo “Timeout Alert”; else echo “No Timeouts”; ———— TIMEOUT=`tail -5000 /dir1/logs/logfile.log | grep “has timed  Full Article…

0

Check if program is running with bash shell script?

This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. check_process(){ # check the args if [ “$1” = “” ]; then return 0 fi #PROCESS_NUM => get the process number regarding the given  Full Article…

0

ps -ef | grep to check if process is running

The script. #! /bin/sh #check the processes and email me if nsexpress is not running if ps -ef | grep “ns-httpd -d /usr/netscape/suitespot/https-lls/config” then echo “nsexpress is running” |mail george.rajapaksa at lls.edu else #echo “nsexpress is not running ” |mail george.rajapaksa at lls.edu cd /usr/netscape/suitespot/https-lls;./start fi The Problem: if pgrep -f “ns-httpd -d /usr/netscape/suitespot/https-lls/config” pgrep  Full Article…

0