RHEL5关于日志,logwatch发给制定邮箱
RHEL5关于日志,logwatch发给制定邮箱。
首先大家都了解每天root都会接收到logwatch发过来的系统报告。报告一些关于磁盘和安全SSH的相关东西。
如下:
[root@kook conf]# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 28 messages 28 unread
>U 1 logwatch@kook.glfsof Mon Dec 17 16:33 44/1584 "Logwatch for kook.glfsoft.com (Linux)"
U 2 logwatch@kook.glfsof Tue Dec 18 04:02 96/2818 "Logwatch for kook.glfsoft.com (Linux)"
U 3 logwatch@kook.glfsof Wed Dec 19 04:02 193/5433 "Logwatch for kook.glfsoft.com (Linux)"
U 4 logwatch@kook.glfsof Thu Dec 20 04:02 99/3056 "Logwatch for kook.glfsoft.com (Linux)"
U 5 logwatch@kook.glfsof Fri Dec 21 04:02 73/2333 "Logwatch for kook.glfsoft.com (Linux)"
U 6 logwatch@kook.glfsof Sat Dec 22 14:57 150/4322 "Logwatch for kook.glfsoft.com (Linux)"
U 7 logwatch@kook.glfsof Wed Dec 26 15:16 44/1584 "Logwatch for kook.glfsoft.com (Linux)"
U 8 logwatch@kook.glfsof Thu Dec 27 04:02 128/3588 "Logwatch for kook.glfsoft.com (Linux)"
U 9 logwatch@kook.glfsof Fri Dec 28 04:02 84/2512 "Logwatch for kook.glfsoft.com (Linux)"
U 10 logwatch@kook.glfsof Sat Dec 29 04:02 70/2133 "Logwatch for kook.glfsoft.com (Linux)"
U 11 logwatch@kook.glfsof Sun Dec 30 04:02 61/1950 "Logwatch for kook.glfsoft.com (Linux)"
U 12 logwatch@kook.glfsof Mon Dec 31 04:03 51/1749 "Logwatch for kook.glfsoft.com (Linux)"
U 13 logwatch@kook.glfsof Wed Jan 2 09:34 44/1581 "Logwatch for kook.glfsoft.com (Linux)"
U 14 logwatch@kook.glfsof Thu Jan 3 04:02 126/3619 "Logwatch for kook.glfsoft.com (Linux)"
U 15 logwatch@kook.glfsof Fri Jan 4 04:02 101/3025 "Logwatch for kook.glfsoft.com (Linux)"
U 16 logwatch@kook.glfsof Sat Jan 5 04:02 51/1747 "Logwatch for kook.glfsoft.com (Linux)"
U 17 logwatch@kook.glfsof Sun Jan 6 04:02 44/1581 "Logwatch for kook.glfsoft.com (Linux)"
U 18 logwatch@kook.glfsof Mon Jan 7 04:02 44/1581 "Logwatch for kook.glfsoft.com (Linux)"
U 19 logwatch@kook.glfsof Tue Jan 8 04:02 75/2461 "Logwatch for kook.glfsoft.com (Linux)"
U 20 logwatch@kook.glfsof Wed Jan 9 04:02 113/3350 "Logwatch for kook.glfsoft.com (Linux)"
U 21 logwatch@kook.glfsof Thu Jan 10 04:02 106/3283 "Logwatch for kook.glfsoft.com (Linux)"
U 22 logwatch@kook.glfsof Fri Jan 11 04:02 121/3535 "Logwatch for kook.glfsoft.com (Linux)"
U 23 logwatch@kook.glfsof Sat Jan 12 04:02 70/2154 "Logwatch for kook.glfsoft.com (Linux)"
U 24 logwatch@kook.glfsof Sun Jan 13 04:02 51/1750 "Logwatch for kook.glfsoft.com (Linux)"
U 25 logwatch@kook.glfsof Mon Jan 14 04:02 53/1815 "Logwatch for kook.glfsoft.com (Linux)"
U 26 logwatch@kook.glfsof Tue Jan 15 04:02 107/3110 "Logwatch for kook.glfsoft.com (Linux)"
U 27 logwatch@kook.glfsof Wed Jan 16 04:02 99/3114 "Logwatch for kook.glfsoft.com (Linux)"
U 28 logwatch@kook.glfsof Thu Jan 17 04:02 89/2839 "Logwatch for kook.glfsoft.com (Linux)"
&
追查一下,logwatch用户发给root的配置文件情况。
[root@kook conf]# pwd
/etc/logwatch/conf
[root@kook conf]# cat logwatch.conf
# Local configuration options go here (defaults are in /usr/share/logwatch/default.conf/logwatch.conf)
[root@kook conf]# cat /usr/share/logwatch/default.conf/logwatch.conf (抽取一下,太多了)
# Default person to mail reports to. Can be a local account or a
# complete email address.
MailTo = root
# Default person to mail reports from. Can be a local account or a
# complete email address.
MailFrom = Logwatch
至此就可以了。如果想发给多个用户,如下修改/etc/logwatch/conf/logwatch.conf文件。
[root@kook conf]# cat logwatch.conf
# Local configuration options go here (defaults are in /usr/share/logwatch/default.conf/logwatch.conf)
MailTo = root,kook@kook.com,kook@test.com
测试一下,执行logwatch,然后去收取邮件。
[root@kook conf]# logwatch
浙公网安备 33010602011771号