日常运维--Zabbix3.4设置邮件告警

本文详述了在Zabbix3.4中设置邮件告警的步骤,包括安装sendmail,配置mailrc,设置邮件发送工具mailx,编写并测试sendmail.sh脚本,以及在Zabbix后台配置报警媒介类型、用户和动作,确保故障和恢复通知的准确发送。
摘要由CSDN通过智能技术生成

 

1、安装sendmail或postfix (邮件传送代理MTA),本教程使用sendmail软件。

(标注:如果直接使用外部邮箱发送邮件可以不需要配置sendmail或postfix,直接把这两个软件关掉,直接跳到第3步:配置mail即可实现) 

[root@ssticentos65 ~]# yum -y install sendmail        #在线yum安装sendmail

[root@ssticentos65 ~]# /etc/init.d/sendmail start     #启动sendmail服务

[root@ssticentos65 ~]# /etc/init.d/sendmail status    #查看sendmail启动情况

sendmail dead but subsys locked                       #sendmail进程锁住,原因是postfix服务启动导致sendmail服务进程锁住,需要关闭postfix服务。

sm-client (pid  1759) is running...

[root@ssticentos65 ~]# /etc/init.d/postfix stop        #暂停postfix服务提示失败,原因是postfix进程正在使用,需要使用kill命令杀掉postfix进程

Shutting down postfix:                                     [FAILED]

[root@ssticentos65 ~]# /etc/init.d/postfix status      #查看postfix服务可以查看到进程号

master (pid  1647) is running...

[root@ssticentos65 ~]# kill -9 1647                    #杀掉postfix服务进程号

[root@ssticentos65 ~]# /etc/init.d/postfix status      #查看postfix状态

master dead but pid file exists

[root@ssticentos65 ~]# chkconfig postfix off           #设置postfix开机不启动

[root@ssticentos65 ~]# /etc/init.d/sendmail stop       #暂停sendmail服务

Shutting down sm-client:     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值