Solved

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

Posted on 2010-09-22
2
1,336 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

756 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