硬件配置
- 2cpu, 4Gmem, 40Gdisk
- Zabbix Server: 200.21.101.14/centos651
- Zabbix Client: 200.21.101.15/centos652
禁用selinux,改完配置重启系统生效
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
添加zabbix软件源
rpm -ivh
ZabbixServer端安装配置
软件安装
yum install zabbix-get zabbix-server zabbix-server-mysql zabbix-web-mysql mysql-server -y
初始化数据库
开启数据库服务service mysqld startchkconfig mysqld on初始化数据库设置mysql_secure_installation
配置数据库
> create database zabbix character set utf8 collate utf8_bin;> grant all privileges on zabbix.* to zabbix[@localhost](http://my.oschina.net/u/570656) identified by 'zabbix_password';> flush privileges;> exit
导入zabbix的表结构和数据
cd /usr/share/doc/zabbix-server-mysql-2.4.8/createmysql -uzabbix -pzabbix_password zabbix < schema.sqlmysql -uzabbix -pzabbix_password zabbix < images.sqlmysql -uzabbix -pzabbix_password zabbix < data.sql
配置WEB界面的设置
编辑/etc/zabbix/web/zabbix.conf.php
配置zabbix_server.conf文件
DBHost = localhostDBName = zabbixDBUser = zabbixDBPassword = zabbix_password
开启zabbix server服务
service zabbix-server startchkconfig zabbix-server on
修改时区
sed -i "s/#\ php_value date.timezone\ Europe\/Riga/php_value date.timezone\ Asia\/Shanghai/g" /etc/httpd/conf.d/zabbix.conf
修改httpd配置
sed -i "s/#ServerName www.example.com:80/ServerName 200.21.101.114/g" /etc/httpd/conf/httpd.confservice httpd startchkconfig httpd on
登录 默认用户名密码Admin/zabbix
Zabbix Client配置
软件安装
yum install zabbix-agent -y
修改客户端配置文件
sed -i "s/Server=127.0.0.1/Server=200.21.101.114/g" /etc/zabbix/zabbix_agentd.confsed -i "s/ServerActive=127.0.0.1/ServerActive=200.21.101.114/g" /etc/zabbix/zabbix_agentd.confsed -i "s/Hostname='Zabbix Server'/Hostname='centos651'/g" /etc/zabbix/zabbix_agentd.confservice zabbix-agent restartchkconfig zabbix-agent on