Zabbix Server 2.2.3 安装步骤,
准备环境:
#groupadd zabbix
#useradd -g zabbix zabbix
#yum install mysql-server mysql-devel gcc gcc-c++ net-snmp-devel curl-devel php php-gd php-mysql php-bcmath php-mbstring php-xml libxml2-devel openipmi ipmitool OpenIPMI-devel
软件安装:
zabbix 官网:http://www.zabbix.com/download.php
zabbix 2.2.9源码包下载
http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.9/zabbix-2.2.9.tar.gz
zabbix 2.2.6源码包下载
http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
zabbix 2.2.3源码包下载
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz
# tar zxf zabbix-2.2.3.tar.gz -C /usr/local/src # cd /usr/local/src/zabbix-2.2.3
#./configure --prefix=/usr/local/zabbix --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --with-libxml2 --with-openipmi ##server和agent一起安装
#make
#make install
# service mysqld start
# mysql -u root -p -A mysql ##输入密码 回车
mysql> create database zabbix character
set
utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> quit;
# cd /usr/local/src/zabbix-2.2.3/database/mysql
# mysql -u root -p -A zabbix < schema.sql ##按顺序来
# mysql -u root -p -A zabbix < images.sql
# mysql -u root -p -A zabbix < data.sql
# vim /usr/local/zabbix/etc/zabbix_server.conf
#修改DB连接数据库账户及密码
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
#cp -R /usr/local/zabbix/sbin/zabbix_server /etc/init.d/
cp -R /usr/local/zabbix/sbin/zabbix_agentd /etc/init.d/
chmod +x /etc/init.d/zabbix_*
# echo "/usr/local/zabbix/sbin/zabbix_server" >> /etc/rc.d/rc.local #添加服务自启动
# echo "/usr/local/zabbix/sbin/zabbix_agentd" >> /etc/rc.d/rc.local
#cat >>/etc/services <<EOF #开放agent和trapper端口
>zabbix-agent 10050/tcp #Zabbix Agent
>zabbix-agent 10050/udp #Zabbix Agent
>zabbix-trapper 10051/tcp #Zabbix Trapper
>zabbix-trapper 10051/udo #Zabbix Trapper
>EOF
#拷贝网页前端文件到apache目录:
#mkdir /var/www/html/zabbix
# cp -R /usr/local/src/zabbix-2.2.3/frontends/php/* /var/www/html/zabbix/
# chown -R apache:apache /var/www/html/zabbix/ #赋予apache权限
修改php参数:
#php参数配置,按照zabbix的需求来。
# vi /etc/php.ini
date.timezone = "Asia/Chongqing"
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
# service httpd restart
# server zabbix_server start
# service zabbix_agentd start
# service mysqld restart
安装部署:
http:
//
127.0.0.1
/zabbix/setup
.php
a) 进入安装界面点击Next
b) 确保所有的监测项都是OK,点击Next
c) 填写zabbix数据库的用户名zabbix、密码zabbix、地址等信息,点击Test connection,OK后点击Next
d) 填写zabbix服务器的信息,主机名,server程序监听的的端口,主机IP地址等,如果server跟web在一台服务器上保持默认即可,点击Next
e) 确认前面几部填写的信息没有问题的话点击Next
f) 检查web程序的config文件,如果没问题会显示OK,直接点击finish即可完成安装(如果此处有问题一般是zabbix虚拟主机目录文件的权限问题,上面已经有设置的过程一般不会出现问题)
Web方式配置完zabbix后,
发现zabbix server is running的value值为No
解决办法:vi /etc/sysconfig/selinux
修改里面的selinux=disabled
重启服务器后解决。