Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We are switching our web server from an ancient AIX box to a new Redhat Enterprise box. One of the daily scripts would look through the httpd error logs and email any errors to our webmaster. It used the errpt command to scrape the day's errors out of the report. I haven't been able to find a command that mimics this. How can we achieve this result on the new box? None of us work with Linux enough to say we actually know the system. We've been able to get by rewriting existing scripts, etc.
Thanks for helping with this. It is an AIX command (not sure if it dates back to pure UNIX or not). On the "translation" sites I've been able to find, they translate errpt to one of 3 Linux commands: cvsbug, bashbug or dmesg. Looking into those commands, though, they only seem to read system error logs at various times. I need the same sort of power, only with whatever error logs we want to point it at (httpd logs, in this case).
Of course, maybe you know another way to strip out the errors from a particular day and email them to the webmaster. Perfectly willing to do this a different way, as long as it can be run by cron.
Not knowing what structure exactly that log has I'd say
(wild guess) that either a perl-script or a shell-script
(utilising awk, for example) would be suitable to do
what you want ... errpt may be faster, though, since
it's a binary (presumably written in C).
If the files aren't TOO huge a shell-script should
easily do, though, since grep and awk are C-compiled
executables, too ...
If you give me a data sample and highlight the info you
need extracted I'm sure that myself or some other
scripting pro can come up with some way of doing it :)
Seems the one script we were trying to get running wasn't the one we really wanted. Another script does just grep out the contents and that one runs okay with some updates to some environment variables.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.