Red hat/CentOS/Fedora通过电子邮件发送Yum软件包更新通知

时间:2020-01-09 10:43:09  来源:igfitidea点击:

我知道如何在Debian/Ubuntu Linux下发送软件包更新电子邮件通知。
当安全性和软件包更新可用时,如何在RHEL v4/5,CentOS,Red Hat和Fedora Linux下发送自动电子邮件通知?
可用升级时,如何强制yum发送电子邮件?

RHEL/Fedora/CentOS具有yum-updatesd,它提供可用于系统的更新通知。
该通知可以通过系统日志,电子邮件或者通过dbus完成。
通过/etc/yum/yum-updatesd.conf文件完成配置。

打开/etc/yum/yum-updatesd.conf文件,执行:

# vi /etc/yum/yum-updatesd.conf

设置变量如下:

emit_via = email
# who to send the email to:
email_to = [email protected]
# who send the notifications
email_from = [email protected]

这是完整的工作配置文件:

[main]
# how often to check for new updates (in seconds)
run_interval = 3600
# how often to allow checking on request (in seconds)
updaterefresh = 600
 
# how to send notifications (valid: dbus, email, syslog)
emit_via = email
# who to send the email
email_to = [email protected]
 
# who send the notifications
email_from = [email protected]
#
# should we listen via dbus to give out update information/check for
# new updates 
dbus_listener = yes
 
# automatically install updates
do_update = no
# automatically download updates
do_download = no
# automatically download deps of updates
do_download_deps = no

保存并关闭文件。
重新启动通知yum-updatesd服务:

# /etc/init.d/yum-updatesd restart

yum通知发送电子邮件示例

Hi,
This is the automatic update system on node02.theitroad.co.in.

There are 2 package updates available. Please run the system updater.

Packages available for update:

    device-mapper-multipath       
    kpartx                        

Thank You,
Your Computer