sed-i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
sed-i 's/^.*DBPassword=.*$/DBPassword=zabbix/g'/usr/local/zabbix/etc/zabbix_server.conf
sed-i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g'/etc/init.d/zabbix_server
sed-i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g'/etc/init.d/zabbix_agentd
7.配置启动脚本,授予启动权限
[root@it3246zabbix-2.2.6]# pwd
/usr/local/src/zabbix-2.2.6
[root@it3246zabbix-2.2.6]# ls
aclocal.m4 conf configure.ac INSTALL man upgrades
AUTHORS config.guess COPYING install-sh misc
bin config.log database m4 missing
build config.status depcomp Makefile NEWS
ChangeLog config.sub frontends Makefile.am README
compile configure include Makefile.in src
[root@it3246zabbix-2.2.6]#
cpmisc/init.d/Fedora/core/zabbix_server /etc/init.d/
[root@it3246zabbix-2.2.6]#
cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/
[root@it3246zabbix-2.2.6]#
[root@it3246zabbix-2.2.6]cp-R frontends/php/ /var/www/html/zabbix
[root@it3246 zabbix-2.2.6]#chmod +x /etc/init.d/zabbix_server
[root@it3246zabbix-2.2.6]# chmod +x /etc/init.d/zabbix_agentd
8.添加服务端口:
[root@it3246zabbix-2.2.6]# cat >>/etc/services <<EOF
> zabbix-agent10050/tcp Zabbix Agent
> zabbix-agent10050/udp Zabbix Agent
> zabbix-trapper10051/tcp Zabbix Trapper
> zabbix-trapper10051/udp Zabbix Trapper
> EOF
9.启动服务,并且加入开机启动项
[root@it3246zabbix-2.2.6]# /etc/init.d/zabbix_server start
Startingzabbix_server: /etc/init.d/functions:line 546: /usr/local/sbin/zabbix_server: 没有那个文件或目录
[失败] /etc/init.d/httpdstart
[root@it3246zabbix-2.2.6]# /etc/init.d/zabbix_server start
Startingzabbix_server: /etc/init.d/functions:line 546: /usr/local/sbin/zabbix_server: 没有那个文件或目录
[root@it3246zabbix-2.2.6]#
echo"/etc/init.d/zabbix_server start">>/etc/rc.local
[root@it3246zabbix-2.2.6]#
echo"/etc/init.d/zabbix_agentd start">>/etc/rc.local
错误提示
解决
(1)进入zabbix_server zabbix_agentd配置文件
[root@it3246zabbix-2.2.6]# vim /etc/init.d/zabbix_server
(2)修改BASEDIR选项
BASEDIR=/usr/local/zabbix
(3)修改完成后,重新启动httpd。
10.web页面配置
10.1 配置http访问好了后web登陆:主要会报一些php报错的信息,对应的修改就好了,date.timezone = Asia/Shanghai
进入该页面按照提示一步一步初始化。
报错:
PHP option post_max_size 8M 16M Fail
PHP option max_execution_time 30 300 Fail
PHP option max_input_time 60 300 Fail
PHP time zone unknown Fail
通过修改php配置文件 /etc/php.ini
解决方法
(1)编辑修改php.ini