Solved

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

Posted on 2010-09-22
2
1,312 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
2 Comments
 
LVL 14

Accepted Solution

by:
Deepak Kosaraju earned 500 total points
Comment Utility
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
Comment Utility
Issue Resolved
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now