|
试想这样一种场景,当公司进了一批新服务器,而这些服务器都可能需要被zabbix所监控时,传统式的手动添加给运维带来了大量的工作负担,就算实现自动化脚本或ansible等工具,还是需要手动在zabbix一台一台主机的添加,而zabbix本身就是支持自动发现并注册功能的,不废话直接上教程。
测试环境:
1台server,一台agent
server操作系统Centos7
agent操作系统Centos6.5 (虚拟机就一台7系统懒得再去装)
1、server端安装:
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
systemctl stop firewalld.service
systemctl disable firewalld.
yum -y install lrzsz lsof httpd mariadb mariadb-server php php-mysql unzip
systemctl start mariadb
systemctl enable mariadb
lsof -i:3306
mysql_secure_installation
systemctl start httpd.service
systemctl enable httpd.service
做php和apache的整合
编写php测试页
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
进入数据库:
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '123';
flush privileges;
cd /usr/share/doc/zabbix-server-mysql-3.2.1
gunzip create.sql.gz
source zabbix |
|
|