You can do something like this:
{
echo "To: You I guess <you@yourdomain.com>"
echo "From: deamon <root@yourbox.com>"
echo "Subject: Whatever"
grep smbd /var/log/file.log #why use less when you already use grep?
}|exim -bm your_addy@your_domain.com
(or pipe it to sendmail -t if that's what you use)
However, why re-invent the wheel? There are tons of logcheckers out there that do a very good job and don't just blindly mail you stuff a certain daemon spit out (though they can be configured to do that). I use logcheck myself as one means to monitor our servers. Try it.


Reply With Quote
Bookmarks