Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Utilizing an array to gracefully append to a list of EmailAddresses
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…
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.:

896 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

16 Experts available now in Live!

Get 1:1 Help Now