zabbix-2.4.0安装

1、安装开发软件包

yum  -y groupinstall  “Development Tools”

2、安装所需的依赖包

yum -y install httpd mysql mysql-server php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdate  php-bcmath zlib-devel mysql-devel glibc-devel curl-devel gcc automake mysql libidn-devel openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel

3、同步服务端的时间,保持所有服务器时间一致避免出现时间不同导致的不可用的监控数据

ntpdate asia.pool.ntp.rog

4、创建zabbix服务运行所需要的用户和组

groupadd  -g 201  zabbix

useradd  -g zabbix  -u 201 -m zabbix

5、初始化mysql服务器

/etc/init.d/mysqld start

6、设置mysql root密码

mysqladmin  -uroot password “123456”

mysql>create database zabbix character set utf8;    创建数据库zabbix

mysql>grant all privileges on zabbix.* to zabbix@’localhost’ identified by ‘zabbix’;

mysql>flush privileges;

7、下载解压zabbix

wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.0/zabbix-2.4.0.tar.gz

tar zxvf zabbix-2.4.0.tar.gz

cd zabbix-2.4.0

将zabbix初始数据导入数据库

 

mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql

8、编译安装zabbix

./configure –-sysconfdir=/usr/local/zabbix/ –enable-server –enable-agent –with-net-snmp –with-libcurl –with-mysql

make&make install

制定配置的路径,默认为/usr/local/etc

9、复制zabbix server、agent端的启动脚本,并设置执行权限

cp misc/init.d/tru64/zabbix_agentd /etc/init.d/

cp misc/init.d/tru64/zabbix_server /etc/init.d/

chmod +x /etc/init.d/zabbix_*

10、配置php文件

vi /etc/php.ini

date.timezone = Asia/Shanghai

max_execution_time = 300

max_input_time = 300

post_max_size = 32M

memory_limit = 128M

mbstring.func_overload = 1

11、配置apache文件,定义安装访问zabbix的虚拟主机

vim /etc/httpd/conf/httpd.conf

ServerName 127.0.0.1

<VirtualHost *:80>

DocumentRoot  “/var/www/html”

ServerName 本机IP

</VirtualHost>

启动 服务

12、打开http://ip/zabbix/setup.php

13、报错  Zabbix server is not running

解决方法。vi /usr/local/zabbix/etc/zabbix_server.conf

修改DBuser=zabbix DBpasswd=zabbix

汉化:vi /var/www/html/zabbix/include/locales.inc.php

‘zh_CN’ => array(‘name’ => _(‘Chinese (zh_CN)’),        ‘display’ => false),

修改为

‘zh_CN’ => array(‘name’ => _(‘Chinese (zh_CN)’),        ‘display’ => true),

发表评论

电子邮件地址不会被公开。 必填项已用*标注