Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Nagios Bash script to trap errors in Oracle Alertlog, Apache http, Websphere Application server logs

Posted on 2010-09-22
2
Medium Priority
?
1,368 Views
Last Modified: 2013-12-10
Gents,
I am looking for a bash script which will search for ERROR CODES listed and return them. I can then use this script thru NAGIOS to carry periodical checks and raise alerts.

Log file examples :

Websphere log will contain entries like below:
ADMU3002E: Exception attempting to process server dmgr

ADMU####X
Where: #### = a unique number
X = Severity level (I = Informational, A = Alert, F = Fatal ?, E = Error, W = Warning)

Oracle log will have details as
Errors in file /u01/app/oracle/product/10.2.0/admin/PROD/bdump/PROD_arc1_3277.trc:
ORA-00308: cannot open archived log '/u06/oradata/PROD/arch/1_61541_684936861.arc'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory

Apache http log will have
[Tue Aug 17 12:10:54 2010] [notice] SSL0198W: System is running without a security library capable of directly rejecting  insecure SSL client renegotiation.  Aborting HTTPS requests that span SSL sessions
[Tue Aug 17 12:10:54 2010] [notice] SSL0198W: System is running without a security library capable of directly rejecting  insecure SSL client renegotiation.  Aborting HTTPS requests that span SSL sessions

Let's take an example Websphere , the script should set 2 array parameters at start

1. Name with full path of log files
LOGS[0]=/opt/IBM/WebSphere/AppServer/profiles/Profile01/Node01/logs/member1/systemout.log
LOGS[1]=/opt/IBM/WebSphere/AppServer/profiles/Profile01/Node01/logs/member2/systemout.log
LOGS[2]=/opt/IBM/WebSphere/AppServer/profiles/Profile01/Node01/logs/nodeagent/systemout.log
LOGS[4]=/opt/IBM/HTTPServer/logs/erorr_log....etc etc

Process Names :
LOGS[0] - NODE_1
LOGS[1] - NODE_2
LOGS[2] - DMGR
LOGS[3] - HTTP SERVER

2. Error Codes to look for
Error[0]=E
Error[1]=W
Error[2]=F

The script must return Process name + Line of error.

I hope I am not asking a lot. Many thanks in advance.

0
Comment
Question by:crazywolf2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Deepak Kosaraju earned 2000 total points
ID: 33733402
The best plugin so far I have been using was
http://labs.consol.de/lang/en/nagios/check_logfiles/
Please go through its documentations it has all option for log parsing monitoring - like CRITICAL Search Pattern, OK Search Pattern etc..
0
 

Author Closing Comment

by:crazywolf2010
ID: 33778045
Issue Resolved
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question