Guest anon Posted March 3, 2005 Report Share Posted March 3, 2005 Trying to run a script to email me but it fails, any ideas on what im doing wrong here? This is the line that causes the problem: sed -e 's/$/\n/g' tmp.txt | exim "Test Report" anon@somedomain This is the error i get; A message that you sent contained a recipient address that was incorrectly constructed: Test Report missing or malformed local part (expected word or "<") Quote Link to comment Share on other sites More sharing options...
paul Posted March 3, 2005 Report Share Posted March 3, 2005 maybe should be "Chris The drunken english geek <anon@somedomain>" Quote Link to comment Share on other sites More sharing options...
Guest anon Posted March 3, 2005 Report Share Posted March 3, 2005 maybe should be"Chris The drunken english geek <anon@somedomain>" <{POST_SNAPBACK}> Damit that works Paul. For anyone thats interested, there's app called logwatch that e-mails you reports from /var/log but it seems to only run on redhat fedora etc. There is no version for MDK. This script takes some interesting tit bits from the logs and e-mails them to you. #! /bin/bash rm -f tmp.txt touch tmp.txt echo "***Uptime***" >> tmp.txt uptime >> tmp.txt echo "***Disk Usage Report***" >> tmp.txt df >> tmp.txt echo "" >> tmp.txt theDate=`date +'%b %e'` echo "***Auth Log Report for $theDate***" >> tmp.txt echo "" >> tmp.txt echo "Failed Attempts:" >> tmp.txt echo "______________________________________________" >> tmp.txt grep "$theDate.*\(failure\|Failed\|Illegal\)" /var/log/auth.log >> tmp.txt echo "" >> tmp.txt echo "" >> tmp.txt echo "Successful Logins:" >> tmp.txt echo "______________________________________________" >> tmp.txt grep "$theDate.*Accepted" /var/log/auth.log >> tmp.txt echo "" >> tmp.txt echo "***Last Logins***" >> tmp.txt last >> tmp.txt echo "" >> tmp.txt echo "" >> tmp.txt echo "***Messages***" >> tmp.txt grep "$theDate" /var/log/messages >> tmp.txt echo "" echo "" >> tmp.txt echo "***Processes Running***" >> tmp.txt ps aux >> tmp.txt echo "" >> tmp.txt sed -e 's/$/\n/g' tmp.txt | mail -s "Server Report" username@domain.tld rm -f tmp.txt You will need to edit the last but one line for your mail program, and also Pauls corection for the email address format. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.