文章目录
1.监控流程
1.提需求
2.监控思路整理
3.监控步骤
添加主机组
添加主机并加入对应的主机组
配置被监控的主机
- 编译安装zabbix-agent
[root@localhost ~]# ls
anaconda-ks.cfg zabbix-4.0.15.tar.gz
[root@localhost ~]# tar xf zabbix-4.0.15.tar.gz
[root@localhost ~]# vi /etc/yum.repos.d/xx.repo
[root@localhost ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# yum -y install gcc gcc-c++ //安装编译工具
[root@localhost zabbix-4.0.15]# yum -y install pcre-devel //安装依赖包
[root@localhost zabbix-4.0.15]# ./configure --enable-agent
[root@localhost zabbix-4.0.15]# make install
- 编辑配置文件
[root@localhost zabbix-4.0.15]# cd /usr/local/etc/
[root@localhost etc]# ls
zabbix_agentd.conf zabbix_agentd.conf.d
[root@localhost etc]# vim zabbix_agentd.conf
把Server和ServerActive后的ip改为监控服务器的ip
[root@localhost etc]# cat zabbix_agentd.conf |grep '^Hostname'
Hostname=192.168.220.10 //可以自定义 但是必须全局唯一 例如ip或者编号
- 创建系统用户
[root@localhost etc]# groupadd -r zabbix
[root@localhost etc]# useradd -r -M -s /sbin/nologin -g zabbix zabbix
- 启动
[root@localhost etc]# zabbix_agentd
添加主机
添加主机
添加监控项(item)
需要监控的对象
添加触发器(trigger)
设置在遇到特定问题时触发报警
添加用户组
不同的项目在不同的组
创建用户并加入对应的用户组
添加媒介
联系方式:邮箱
添加动作
发邮件
手动触发并验证
故意出问题来验证