- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Monitoring logifiles for errors hourly
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2007 10:17 AM
05-23-2007 10:17 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2007 10:51 AM
05-23-2007 10:51 AM
Re: Monitoring logifiles for errors hourly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2007 05:23 PM
05-23-2007 05:23 PM
Re: Monitoring logifiles for errors hourly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2007 07:17 PM
05-23-2007 07:17 PM
Re: Monitoring logifiles for errors hourly
Why not make a copy of the log file every hour, then diff it and search the diff. It will use space but solve the time problem.
Example:
diff sample.log sample1.log | grep ^\< | cut -c 2- > search.log
cp -p sample.log sample1.log
The data will be in search.log
Another solution would be to run a x=`wc -l sample.log` on the log file every hour and when you scan the log file skip the first x lines, however thats a little more work and if the contents of the log files are reset or logrtated you could end up with a problem.
Regards
Andrew Y
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2007 07:49 PM
05-24-2007 07:49 PM
Re: Monitoring logifiles for errors hourly
please, post an example of your log file so I'll be bale to help you in wrting script based on the line format you have.
Rgds,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2007 03:58 AM
05-25-2007 03:58 AM
Re: Monitoring logifiles for errors hourly
Here's a line of the log I am looking for errors in:
17:03:02|SELA=00:03:00|SUBM=dms@dbmsn01|SNOD=NDM.SPARE|CCOD=16|RECI=PERR|RECC=CAPR|LNOD=P|PNOD=dbmsn01|MSST=Process fatal error
So to go along with Andrew's suggestion, is there a way to maybe grep for every line that begins with the current time and includes lines for the previous 60 minutes, re-direct that to another temporary log and then grep that log for the 'fatal' error condition?
Thanks again all for your assistance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2007 04:30 AM
05-25-2007 04:30 AM
SolutionHOUR=$(date +%H)
if (( ${HOUR} == 0 )) ; then
PREVHOUR=23
else
let PREVHOUR=${HOUR}-1
fi
Then you can try doing your grep. You should be able to combine it into something like:
grep ^${PREVHOUR}: filename | grep -i fatal
The ^${PREVHOUR}: will look for the value of previous hour at the beginning of the line with a : after it, like 17:.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2007 05:44 AM
05-25-2007 05:44 AM
Re: Monitoring logifiles for errors hourly
I used the PREVHOUR statement you shared and that solved my issue.
Thanks again to all who responded...