企业级监控软件Zabbix搭建部署之zabbix server的安装(2)

05.3.导入zabbix数据库
[root@Zabbix-Server zabbix-2.0.8]# mysql -uroot -p123.com zabbix < /home/zabbix-2.0.8/database/mysql/schema.sql
[root@Zabbix-Server zabbix-2.0.8]# mysql -uroot -p123.com zabbix < /home/zabbix-2.0.8/database/mysql/images.sql
[root@Zabbix-Server zabbix-2.0.8]# mysql -uroot -p123.com zabbix < /home/zabbix-2.0.8/database/mysql/data.sql

05.4.安装zabbix Server
[root@Zabbix-Server zabbix-2.0.8]# ./configure —prefix=/usr/local/zabbix/ —enable-server —enable-proxy —enable-agent —with-mysql —with-net-snmp —with-libcurl
[root@Zabbix-Server zabbix-2.0.8]# make && make install

05.5.修改配置文件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

05.6.修改zabbix Server的配置文件,修改数据库的User password
[root@Zabbix-Server zabbix-2.0.8]# vim /usr/local/zabbix/etc/zabbix_server.conf

把其中的DBUser=root换成DBUser=zabbix
添加DBPassword或者去掉注释掉的#DBPassword
DBPassword=123.com

05.7.配置启动脚本,并且给执行权限;
[root@Zabbix-Server zabbix-2.0.8]# cp misc/init.d/Fedora/core/zabbix_* /etc/init.d/
[root@Zabbix-Server zabbix-2.0.8]# sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/' /etc/init.d/zabbix_server
[root@Zabbix-Server zabbix-2.0.8]# sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/' /etc/init.d/zabbix_agentd
[root@Zabbix-Server zabbix-2.0.8]# chmod +x /etc/init.d/zabbix_server
[root@Zabbix-Server zabbix-2.0.8]# chmod +x /etc/init.d/zabbix_agentd
[root@Zabbix-Server zabbix-2.0.8]#

05.8.启动zabbix
[root@Zabbix-Server zabbix-2.0.8]# /etc/rc.d/init.d/zabbix_server start
Starting zabbix_server: [ OK ]
[root@Zabbix-Server zabbix-2.0.8]#

05.9.web页面中配置zabbixServer
[root@Zabbix-Server zabbix-2.0.8]# cp -a frontends/php/* /var/www/html/
cp: overwrite `/var/www/html/index.php'? y
[root@Zabbix-Server zabbix-2.0.8]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@Zabbix-Server zabbix-2.0.8]#

05.10.修改php.ini文件
处理zabbixweb中的时区错误问题
[root@Zabbix-Server zabbix-2.0.8]# sed -i 's/^post_max_size = ./post_max_size = 16M/' /etc/php.ini
[root@Zabbix-Server zabbix-2.0.8]# sed -i 's/max_execution_time = ./max_execution_time = 300/' /etc/php.ini
[root@Zabbix-Server zabbix-2.0.8]# sed -n 's/^max_input_time = ./max_input_time = 300/gp' /etc/php.ini
max_input_time = 300
[root@Zabbix-Server zabbix-2.0.8]# sed -i 's/^max_input_time = ./max_input_time = 300/' /etc/php.ini
[root@Zabbix-Server zabbix-2.0.8]#

如果改了以上,还是报上面那个错误,就改一下文件,在代码的开始行,加入ini_set(‘date.timezone’,'Asia/Shanghai’);
添加如下一行:大概在配置文件的22行之前

vi /var/www/html/zabbix/include/page_header.php

ini_set(‘date.timezone’,‘Asia/Shanghai’);

05.11.重启服务
[root@Zabbix-Server zabbix-2.0.8]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@Zabbix-Server zabbix-2.0.8]#
[root@Zabbix-Server ~]# /etc/rc.d/init.d/zabbix_server restart
Shutting down zabbix_server: [ OK ]
Starting zabbix_server: [ OK ]
[root@Zabbix-Server ~]# /etc/rc.d/init.d/zabbix_agentd restart
Shutting down zabbix_agentd: [FAILED]
Starting zabbix_agentd: [ OK ]
[root@Zabbix-Server ~]#
设置成开机启动服务
[root@Zabbix-Server ~]# echo "/etc/rc.d/init.d/zabbix_agentd" >> /etc/rc.local
[root@Zabbix-Server ~]# echo "/etc/rc.d/init.d/zabbix_server" >> /etc/rc.local

05.12.创建自定义模板

针对Zabbix添加模板可以做链接—例如存在模板—-Template OS Linux
我们创建一个新的模板引用关联Template OS Linux这个模板就可以使用了~~~~~
然后我们在自定义我们监控的选项,还可以定义我们选择的图片

关于web界面的配置请看下一篇<企业级监控软件zabbix搭建部署之zabbix Services web中配置>

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

转载注明出处:http://www.heiqu.com/4d277406b3f72df03426a48705308677.html