Solved

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

707 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