zabbix web界面告警
在配置之前zabbix_serve端还要下载postfix并启动
[root@server ~]# yum -y install postfix
[root@server ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@server ~]# systemctl start postfix
[root@server ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 100 127.0.0.1:25 0.0.0.0:*
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 0.0.0.0:10051 0.0.0.0:*
LISTEN 0 128 127.0.0.1:9000 0.0.0.0:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 100 [::1]:25 [::]:*
LISTEN 0 80 *:3306 *:*
手动添加监控项(服务端)
为web01添加监控项
我们先要在客户端(zabbix_agent)的/tmp/下面创建一个文件来监控这个文件,如果把文件放在其他目录,就需要把相关权限赋予zabbix用户
[root@client ~]# cd /tmp
[root@client tmp]# ls
zabbix_agentd.log zabbix_agentd.pid
[root@client tmp]# touch test
[root@client tmp]# ls
zabbix_agentd.log zabbix_agentd.pid test
继续添加监控项
向客户端的/tmp/test文件中写入,再次查看
[root@client tmp]# echo "1231" >> test
[root@client tmp]#
添加触发器
客户端中/tmp/test文件中插入数据,测试问题页面是否告警
[root@client tmp]# echo "1231" >> test
[root@client tmp]#
配置用户媒介类型
在配置用户媒介之前要授权邮箱来发送邮件,我这里使用的是邮箱163.com
配置用户媒介(email)邮箱
用户界面配置
添加动作
验证
再次在客户端中/tmp/test文件中插入数据,测试问题页面是否告警并发送邮件
[root@client tmp]# echo "1231" >> test
[root@client tmp]#