have a look at script i want to add multiple error in "ALERT" Variable but getting error nor getting required result.when im writing only one error then script is running successfully.Kindly suggest me how i add multiple error in this script as i can get required result.
For single hard code error like ALERT="ORA-00060" it working perfect. Thanks in advance. #!/bin/sh #GLOBS ALERT="ORA-00060","TNS","crash","Error",'abort","cannot allocate","not complete","waiting","All online" ; LOGFILE=/path/to/my/alert_X.log MYFILE=/home/user/test.log ## #get the errors out of the logfile. grep -h "$ALERT" $LOGFILE >> $MYFILE #count number of lines in myfile, and print. VAR=`wc -l $MYFILE | awk -F" " '{print $1}'` #echo $VAR # if the amount of lines is greater than 0, then cat the file and send it to me. if not then echo all clear. #size variable is the number of errors the last time the script ran size=`wc -l test.last | awk -F" " '{print $1}'` echo $size # if the amount of lines is greater than 0, then cat the file and send it to me. if not then echo all clear if [[ $VAR -gt $size ]] ; then cat $MYFILE | mail -vs "oralert" user@domain.com ; else echo "All clear.." fi; rm test.last mv test.log test.last |
Please suggest me how to add diff critical error in this script.
here in this script u have only defined one ALERT="ORA-00060"; .I tried to add multiple error as same type of error came in my alert log so i can easily rectify ASAP.Kindly help me add multiple ora error nhn with ALERT="ORA-00060"; Thanks in Advance |
While English may not be your first language you must realize that just repeating your question isn't going to solve things.
It should look something like this: Code:
#!/bin/sh -- |
All times are GMT -5. The time now is 12:20 AM. |