64位CentOS 6.2下安装Zabbix 2.0.6

64位CentOS 6.2下安装Zabbix 2.0.6

1、安装组件

yum install make MySQL-server httpd php mysql-devel gcc net-snmp-devel curl-devel p3rl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml -y

useradd zabbix

2、启动mysql
service mysqld start
mysqladmin –u root password root
mysql –u root –p

输入密码root
3、创建zabbix数据库
Mysql> create database zabbix character set utf8;
Mysql> grant all on zabbix.* TO zabbix@'localhost' identified by 'zabbixpass';
Mysql> flush privileges;
4、导入数据库sql
zabbix-2.0.6/database/mysql
mysql -h localhost -uroot -proot zabbix <schema.sql

mysql -h localhost -uroot -proot zabbix <images.sql
mysql -h localhost -uroot -proot zabbix <data.sql
5、调整当前时间(这个时间对的话就不要调整了)
 date -s "2013-04-26 20:48:55"     
6、编译安装
./configure --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy --prefix=/usr/local/zabbix
make && make install
7、添加端口
vim /etc/services

zabbix-agent    10050/tcp              # Zabbix Agent
zabbix-agent    10050/udp              # Zabbix Agent
zabbix-trapper  10051/tcp              # Zabbix Trapper
zabbix-trapper  10051/udp              # Zabbix Trapper

8、修改配置文件
修改/etc/httpd/conf/httpd.conf
DirectoryIndex index.html index.html.var index.php
修改/usr/local/zabbix/etc/zabbix_server.conf参数:
DBName=zabbix
DBUser=root
DBPassword=root

cp misc/init.d/Fedora/core5/zabbix_server /etc/init.d/
cp misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
chmod 700 /etc/init.d/zabbix_*


vim /etc/init.d/zabbix_server
修改
    ZABBIX_BIN="/usr/local/sbin/zabbix_server"

    ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_server"
vim /etc/init.d/zabbix_agentd
修改
    ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"

    ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
9、启动服务并设置开机启动
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start


chkconfig zabbix_server on
chkconfig zabbix_agentd on
10、修改php相关参数
# vi /etc/php.ini    找到如下几项,改成下面的值,前面有;号的要删掉
max_execution_time = 300
max_input_time = 300
date.timezone = PRC
post_max_size = 32M


重启httpd
/etc/init.d/httpd restart

11、配置php文件
# cd zabbix-2.0.6
# cd frontends/
# cp -rf php /var/www/html/
# cd /var/www/html
# mv php zabbix
# chown -R zabbix:zabbix zabbix

登录

其中配置DB时mysql的账号和密码都是root,

64位CentOS 6.2下安装Zabbix 2.0.6

最后这步显示fail,后来按照提示将zabbix.conf.php的文件下载了cp 到/var/www/html/conf/

64位CentOS 6.2下安装Zabbix 2.0.6

最后显示
Configuration file
"/var/www/html/zabbix/conf/zabbix.conf.php"
created: OK

安装成功后,初始登录账号admin,密码zabbix

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/bffc084742b9877fbe1cf643618b0637.html