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.
I would assume you want secure communications for your log files so just use scp. Something like "scp remote_host_name:/directory/sub_directory/log_file ." <- that's a period or dot, meaning the current directory for the log file destination. Before this would work, you'd need to set up secure shell private keys so you won't have to put in passwords in your scripts. You can edit crontab to send this out periodically under the proper user id.
Next you need to set up an MTA like sendmail. That's complex, but then you can e-mail from scripts using something like:
cat log_file | mail -s "Here is the email subject" email-id@some-domain.com &
the & is used to run in the background. This will put the log file contents in the body of the email. You don't have to pipe to the mailer file into the mailer. This is just one way to do it. I use it for daily reporting on my servers. It works well. The hardest part was setting up sendmail.
Unfortunately no one can set your system up to do this stuff or give you the specific steps. We can help you with specific challenges for your circumstances or set up, but without comprehensive information, no one can solve your problem outright. So I did the best I could by giving you one general method that works for me.
Logwatch (http://www2.logwatch.org:81/) is a very handy tool that can probably do what you want with a little less configuration.
Logwatch is a customizable log analysis system which might take you an afternoon or so to understand, but you can make it do whatever you want and then send the report by mail.
The flexibility means you could send the entire log file (if your mail server accepts the size of the log file) or just a summary of what went on during the day.
Usually it configures itself under cron, which is mighty helpful.
Most distributions have Logwatch as a package along with summary tools for all the main services (mail, NFS, ssh, bind etc).
I've heard of Logwatch. Thanks for posting that reply. I've always written my own filters, summaries, and reports. I should take a look at that for myself.
But I didn't get any mail to praveen198537@gmail.com
I think the above command alone sufficient... right?
Please reply soon as possible.
I'm doing internal project and I have to complete it soon.
Can you send me your personal email id for further clarifications.
Bye MeetScott.
Quote:
Originally Posted by meetscott
I would assume you want secure communications for your log files so just use scp. Something like "scp remote_host_name:/directory/sub_directory/log_file ." <- that's a period or dot, meaning the current directory for the log file destination. Before this would work, you'd need to set up secure shell private keys so you won't have to put in passwords in your scripts. You can edit crontab to send this out periodically under the proper user id.
Next you need to set up an MTA like sendmail. That's complex, but then you can e-mail from scripts using something like:
cat log_file | mail -s "Here is the email subject" email-id@some-domain.com &
the & is used to run in the background. This will put the log file contents in the body of the email. You don't have to pipe to the mailer file into the mailer. This is just one way to do it. I use it for daily reporting on my servers. It works well. The hardest part was setting up sendmail.
Unfortunately no one can set your system up to do this stuff or give you the specific steps. We can help you with specific challenges for your circumstances or set up, but without comprehensive information, no one can solve your problem outright. So I did the best I could by giving you one general method that works for me.
Logwatch (http://www2.logwatch.org:81/) is a very handy tool that can probably do what you want with a little less configuration.
Logwatch is a customizable log analysis system which might take you an afternoon or so to understand, but you can make it do whatever you want and then send the report by mail.
The flexibility means you could send the entire log file (if your mail server accepts the size of the log file) or just a summary of what went on during the day.
Usually it configures itself under cron, which is mighty helpful.
Most distributions have Logwatch as a package along with summary tools for all the main services (mail, NFS, ssh, bind etc).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.