zabbix 2.2.2 安装部署
zabbix 2.2.2版本与1.8.3版本安装过程略有不同,下面为实施步骤:
服务端:172.16.1.61
客户端:172.16.1.8
搭建zbbix软件
安装LAMP环境及依赖包
-
[root@localhost ~]# yum install mysql-server mysql-devel libcurl-devel net-snmp-devel php php-gd php-xml php-mysql php-mbstring php-bcmath httpd
添加用户
-
[root@localhost ~]# groupadd zabbix
-
[root@localhost ~]# useradd zabbix -g zabbix
创建数据库,添加用户授权
-
[root@localhost ~]# /etc/init.d/mysqld start
-
[root@localhost ~]# mysql -e "create database zabbix character set utf8;"
-
[root@localhost ~]# mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by '111111';"
编译安装zabbix
- 安装下载
yum install gcc gcc-c++ wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz/download
- 编译
-
[root@localhost ~]# cd /usr/local/src/
-
[root@localhost src]# tar zxf zabbix-2.0.2.tar.gz
-
[root@localhost src]# cd zabbix-2.0.2
-
[root@localhost zabbix-2.0.2]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
-
[root@localhost zabbix-2.0.2]# make install
导入数据库
-
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p'111111' zabbix < database/mysql/schema.sql
-
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p'111111' zabbix < database/mysql/images.sql
-
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p'111111' zabbix < database/mysql/data.sql
拷贝、修改配置文件
-
[root@localhost zabbix-2.0.2]# sed -i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
-
[root@localhost zabbix-2.0.2]# sed -i 's/^.*DBPassword=.*$/DBPassword=111111/g' /usr/local/zabbix/etc/zabbix_server.conf
-
[root@localhost zabbix-2.0.2]# cp -r frontends/php /var/www/html/zabbix
-
[root@localhost zabbix-2.0.2]# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
-
[root@localhost zabbix-2.0.2]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
-
[root@localhost zabbix-2.0.2]#sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_server
-
[root@localhost zabbix-2.0.2]#sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_agentd
添加服务端口
-
[root@localhost ~]# cat >>/etc/services <<EOF
-
zabbix-agent 10050/tcp Zabbix Agent
-
zabbix-agent 10050/udp Zabbix Agent
-
zabbix-trapper 10051/tcp Zabbix Trapper
-
abbix-trapper 10051/udp Zabbix Trapper
-
EOF
修改php.ini
-
[root@localhost ~]#sed -i 's/^\(.*\)date.timezone =.*$/date.timezone = Asia\/Shanghai/g' /etc/php.ini
-
[root@localhost ~]#sed -i 's/^\(.*\)post_max_size =.*$/post_max_size = 16M/g' /etc/php.ini
-
[root@localhost ~]#sed -i 's/^\(.*\)max_execution_time =.*$/max_execution_time = 300/g' /etc/php.ini
-
[root@localhost ~]#sed -i 's/^\(.*\)max_input_time =.*$/max_input_time = 300/g' /etc/php.ini
编写配置文件
-
[root@localhost zabbix-2.0.2]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
-
Server=172.16.1.61
-
ServerActive = 172.16.1.61
-
Hostname=172.16.1.61
-
[root@localhost zabbix-2.0.2]# /etc/init.d/zabbix_agentd start
-
[root@localhost zabbix-2.0.2]# tail -f /tmp/zabbix_agentd.log
启动服务
-
[root@localhost ~]# /etc/init.d/zabbix_server start
-
[root@localhost ~]# /etc/init.d/zabbix_agentd start
-
[root@localhost ~]# /etc/init.d/httpd start
WEB配置服务
以下截图是在安装2.0.1版本的截图,2.0.2版本完全一致。
检查php环境
数据库配置
主机IP,端口
预览配置
配置Fail,点击Save configuration file将zabbix.conf.php保存到本地,再上传至服务器/var/www/html/zabbix/conf目录,然后Retry
刷新后配置正确,点击Finsh完成
登陆页面,默认用户名:admin 密码:zabbix
登陆首页
更换语言
更换中文后图像出现乱码解决方法:上传windows中文字体到服务器替换原字体。
-
[root@localhost ~]#cd /var/www/html/zabbix/fonts
-
[root@localhost ~]#mv DejaVuSans.ttf DejaVuSans.ttf_bak #备份原字体
-
[root@localhost ~]#mv msyh.ttf DejaVuSans.ttf #雅黑字体
客户端安装,这次新版本采用源码安装
添加用户
-
[root@localhost ~]# groupadd zabbix
-
[root@localhost ~]# useradd zabbix -g zabbix
解压文件
-
[root@localhost ~]# cd /usr/local/src/
-
[root@localhost src]# tar zxf zabbix-2.0.2.tar.gz
编译安装
-
[root@localhost src]# cd zabbix-2.0.2
-
[root@localhost zabbix-2.0.2]# ./configure --prefix=/usr/local/zabbix --enable-agent
-
[root@localhost zabbix-2.0.2]#?make install
-
[root@localhost zabbix-2.0.2]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
-
?[root@localhost zabbix-2.0.2]#sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_agentd
编写配置文件
-
[root@localhost zabbix-2.0.2]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
-
Server=172.16.1.61
-
ServerActive = 172.16.1.61
-
Hostname=Zabbix-client
-
[root@localhost zabbix-2.0.2]# /etc/init.d/zabbix_agentd start
-
[root@localhost zabbix-2.0.2]# tail -f /tmp/zabbix_agentd.log
甲壳虫免杀论坛版主------jks_巴顿