1.添加主机/主机组
2.添加监控项
手动添加
模板添加
3.添加触发器trigger
4.定义媒介(告警通知方式)
5.配置动作(告知、处理)
6.手动触发并验证
环境 | IP | 要安装的应用 |
---|---|---|
服务器 | 192.168.10.131 | lamp架构、zabbix server 、zabbix agent |
客户端 | 192.168.10.132 | zabbix agent |
[root@slave ~]# systemctl disable --now firewalld
[root@slave ~]# setenforce 0
SELINUX=disabled
wget .4/zabbix-6.4.
tar xf zabbix-6.4.
[root@slave opt]# yum -y install gcc gcc-c++ pcre-devel make --allowerasing
[root@slave ~]# useradd -r -M -s /sbin/nologin zabbix
[root@slave zabbix-6.4.6]# ./configure --help | grep agent--enable-agent Turn on build of Zabbix agent and client utilities--enable-agent2 Turn on build of Zabbix agent 2
[root@slave zabbix-6.4.6]# ./configure --enable-agent
......LDAP support: noIPv6 support: nocmocka support: noyaml support: no***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <; *
***********************************************************
[root@slave zabbix-6.4.6]# make install
....
[root@slave zabbix-6.4.6]# cd /usr/local/etc/
[root@slave etc]# ls
f f.d
[root@slave etc]# vim f
#找到以下三行
Server=
ServerActive=
Hostname=
#改为
Server=192.168.10.131 #这里改为服务端主机的ip地址
ServerActive=192.168.10.131 #这里也是改为服务端主机的ip地址
Hostname=192.168.10.132linux #主机名必须要是全局唯一的,因为后面要用到,建议改成IP地址+操作系统
#复制一份其他的配置文件
[root@slave ~]# cp /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/zabbix_agentd.service
[root@slave ~]# vim /usr/lib/systemd/system/zabbix_agentd.service
[root@slave ~]# cat /usr/lib/systemd/system/zabbix_agentd.service #内容改为
[Unit]
Description=zabbix agentd #名字
After=network.target[Service]
Type=forking #类型
ExecStart=/usr/local/sbin/zabbix_agentd #把启动服务的方式,启动服务zabbix_agentd
ExecStop=pkill zabbix_agentd #停止服务,停止服务直接输入pkill zabbix_agentd
ExecReload=/bin/kill -HUP $MAINPID #重新加载[Install]
WantedBy=multi-user.target
[root@slave ~]#
[root@slave ~]# systemctl daemon-reload
[root@slave ~]# systemctl enable --now zabbix_agentd
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix_agentd.service → /usr/lib/systemd/system/zabbix_agentd.service.
[root@slave ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
在网页界面的左边Monitoring选项下面的Hosts
在监控的文件中加入新的数据,使其值发生改变
[root@slave tmp]# echo "1234" >> test
[root@slave tmp]#
告警文件发生改变
[外链图片转存中…(img-8MRsCZzv-1695658149292)]
[外链图片转存中…(img-EkDs2gsC-1695658149292)]
[外链图片转存中…(img-h2OrQJFl-1695658149292)]
[外链图片转存中…(img-mOAhNTlW-1695658149292)]
[外链图片转存中…(img-yv84YrnB-1695658149292)]
[外链图片转存中…(img-c2EToRb1-1695658149292)]
本文发布于:2024-01-29 18:30:00,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170652420317431.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |