LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   unable to get tool chain to send daily updates (http://www.linuxquestions.org/questions/linux-general-1/unable-to-get-tool-chain-to-send-daily-updates-4175448884/)

purpman 02-06-2013 09:15 AM

unable to get tool chain to send daily updates
 
i am having trouble getting this tool chain to send daily updates.
this is what i want it to do:have server storing security logs and need to contact admin via email in specific risk scenarios(loss of power,hacker attack,virus download,improper login, denied websites) but it also needs to send daily updates. this is what i have but it is not sending daily updates

$ cat my_check.sh
egrep -i 'warn|error' /var/log/messages | mail -s 'issues worth reviewing' some_user@some_host
$ ./my_check.sh
$ crontab -e
#
1 0 * * * /path/to/my_check.sh

any suggestions will be appreciated

chrism01 02-06-2013 06:54 PM

I'd go step by step.

Step 1:
does it work direct from the cmd line ie
Code:

egrep -i 'warn|error' /var/log/messages | mail -s 'issues worth reviewing' some_user@some_host
If that doesn't work, wrapping it in a script and cron isn't going to help.

If the direct cli call doesn't work, do you see any msgs?
Check the logfiles eg /var/log/messages, /var/log/maillog.
Also, try mailq -Ac, mailq -Lq http://www.oreillynet.com/linux/cmd/...p?path=m/mailq

Tell us what distro & version
Code:

cat /etc/*release*
uname -a

Which MTA ? eg sendmail, postfix... ? Have a look in /etc.

purpman 02-07-2013 10:22 AM

tool chain
 
thank you

egrep -i 'warn|error' /var/log/messages | mail -s 'issues worth reviewing' some_user@some_host

this worked sheesh knew it was something simple

chrism01 02-07-2013 08:10 PM

So what was the fix: that looks exactly as your original post?


All times are GMT -5. The time now is 10:20 AM.