Hi pseudocoder,
you are right. But my main intention of putting the echo there was to check what line in the script has been executed so far. Also I need to figure out how nt to send a mail if nothing is found from the searched string pattern.
I still am trying to figure out how the script can be modified to monitor and report only new entries when it is run for the second time with the same log file as an argument.
---------- Post updated at 08:44 AM ---------- Previous update was at 08:42 AM ----------
thanks for pointing that out. I will remember to take that out as it looks a bit misleading.
---------- Post updated at 01:36 PM ---------- Previous update was at 08:44 AM ----------
I have reformatted the code to suit the needs of the script task.
I have tried to highlight all the pieces of code that has been shifted, added or changed in blue.
All improvements required are highlighted in red. I have updated certain parts of the code and highlighted it using orange I get the following error if the search pattern doesnt match. At least that that is what the problem according to me. The output of an unsuccessful run is as below: The output of a successful run is as below:
I am not sure that the following code works as it should.
---------- Post updated at 01:55 PM ---------- Previous update was at 01:36 PM ----------
Found the problem with the if statement. Changes are in blue
The output now if the log file does not contain the string pattern is
---------- Post updated at 06:05 PM ---------- Previous update was at 01:55 PM ----------
The script now basically works fine.Certain advanced requirements of the script task that i have not implemented are:
If same script is renamed to logcheck then the reports the script generates should be displayed in the command line.
Error messages that are repeated are to be counted and only one instance of error message is to be reported followed by the comment "The above message appeared n times"
Note: Time stamp is being ignored when making the above improvements. i.e a log entry having identical time stamps will not be considered when grouping messages.
The code is as below. I have reformatted the entire code, so have not highlighted parts of the code.
The output of a successful run will be as below depending on the situation: Could someone please help me with the advanced parts. I need urgent help to finish this script off today itself.
Last edited by vin8465; 06-02-2010 at 09:25 PM..
Reason: Updated code to match code format
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
I am stuck and worried. My assignment was due a day ago and I was too busy completing other assignments due during the same time. I worry that not completing this assignment... (1 Reply)
i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail.
actually i am trying to automate the high... (2 Replies)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (1 Reply)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (7 Replies)
Hi All
Need help
Can any one share a basic script that is used for monitor sendmail service whether online, offline.etc in solaris
Thanks in advance
Zimmy (5 Replies)
Hi
I want to monitor a file even if the file rotate. When a text occurs I want to send a mail.
Something like this but it's not working correctly:
tail -F mylog.log | grep 'MatchMe' |
while read line
do
echo $(date +"%Y-%m-%d %H:%M:%S") MatchMe occurs | mail -s "MatchMe"... (1 Reply)
Hello,
I wanted to search specific string in the acitve log file and send an email if the search string found in the log.
Log file is written by application all the time. So, script has to search if any new log entry has the specific string for example " sample exception" and send an email. (1 Reply)
I want to monitor the maillog file in real time and send a mail when a certain grep condition is met. Every time the grep condition is met a mail will be sent. I wish to ignore all grep conditions 30 mins after each mail and thereafter continue monitoring.
For example:
Condition is met, mail... (1 Reply)
I am having trouble getting mail to work on a red hat server. At first I was getting this message.
Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused
Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)