①Down File tar.gz url:
#yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI php-gd php-xml php-bcmath
#tar zxf zabbix 2.2.2.tar.gz
#cd zabbix 2.2.2
创建zabbix数据库:
#mysql -uroot -p
>create database zabbix;
>grant all on zabbix.* to zabbix@localhost identified by '123456';
>flush privileges;
导入zabbix的数据:
#mysql -u root -h 127.0.0.1 -p zabbix < database/mysql/schema.sql
#mysql -u root -h 127.0.0.1 -p zabbix < database/mysql/images.sql
#mysql -u root -h 127.0.0.1 -p zabbix < database/mysql/data.sql
编译安装zabbix:
#./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl
[注意核对自己mysql_config文件位置]
#make ;make install
②检查服务里面zabbix的配置内容:
#cat >>/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
EOF
#mkdir /etc/zabbix
#"cp -r conf/* /etc/zabbix"
#cp -r frontends/php /var/www/html/zabbix
#vi /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBUDBPassword=123456
③为zabbix启动、关闭和重启的脚本文件做链接
#cd /usr/local/zabbix/bin/
#for i in *;do ln -s /usr/local/zabbix/bin/${i} /usr/bin/${i};done
#cd /usr/local/zabbix/sbin/
#for i in *;do ln -s /usr/local/zabbix/sbin/${i} /usr/sbin/${i};done
把mysql的lib库文件添加到系统动态库配置文件中,方便系统可以找到mysql的lib库
#echo “/usr/local/mysql-5.1.56/lib/mysql/” >>/etc/ld.so.conf
#ldconfig //使上面的操作立即生效
④添加开机启动服务(Faliure)
#chkconfig --add zabbix_server
#chkconfig --add zabbix_agentd
#chkconfig --level 345 zabbix_server on
#chkconfig --level 345 zabbix_agentd on
#vi /etc/php.ini
更改下面设置,以满足zabbix安装需求:
date_default_timezone_set("Asia/Shanghai")
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
zabbix默认账号密码:admin==zabbix
通过以下方式查看主机的时区,来保持与zabbix的时区一致:
#cat /etc/sysconfig/clock
完事之后一张效果图:
阅读(1681) | 评论(0) | 转发(0) |