re2323 发表于 2015-6-11 09:05:38

centos6.5安装zabbix2.4.5

# yum -y install net-snmp net-snmp-devel libxml2-devel libcurl-devel
# wget http://downloads.sourceforge.net ... zabbix-2.4.5.tar.gz
# tar zxf zabbix-2.4.5.tar.gz
# cd zabbix-2.4.5
# useradd -M -s /sbin/nologin zabbix
#./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent --with-libxml2

configure: error: Not found mysqlclient library

1
2
# yum install -y mysql-devel
#./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent --with-libxml2




configure: error: Jabber library not found
http://pan.baidu.com/s/1lUn4U 下载iksemel-1.4.tar.gz

1
2
3
4
5
6
# tar zxf iksemel-1.4.tar.gz
# cd iksemel-1.4
# ./configure --prefix=/usr/local/
# make -j4 && make install
# cd ..
#./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber=/usr/local/ --with-libcurl --with-openipmi --enable-agent --with-libxml2




configure: error: Invalid OPENIPMI directory - unable to find ipmiif.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# yum install -y OpenIPMI-devel
# ./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber=/usr/local/ --with-libcurl --with-openipmi --enable-agent --with-libxml2
# make -j4 && make install
# mysql -uroot -p
mysql> create database zabbix default charset utf8;
Query OK, 1 row affected (0.04 sec)
mysql> grant all on zabbix.* to zabbix@'%' identified by 'zabbix123';
Query OK, 0 rows affected (0.06 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.07 sec)
mysql> exit
# cd database/mysql/
# mysql -uzabbix -pzabbix123 zabbix < schema.sql
# mysql -uzabbix -pzabbix123 zabbix < images.sql
# mysql -uzabbix -pzabbix123 zabbix < data.sql
# cd ../../
# cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
# chmod 775 /etc/init.d/zabbix_*
# vim /usr/local/zabbix/etc/zabbix_server.conf
30 LogFile=/var/log/zabbix_server.log
68 DBHost=localhost
94 DBUser=zabbix
102 DBPassword= zabbix123
117 DBPort=3306
# vim /etc/init.d/zabbix_server
22 BASEDIR=/usr/local/zabbix
# vim /etc/init.d/zabbix_agentd
22 BASEDIR=/usr/local/zabbix
# vim /usr/local/php/etc/php.ini
444 max_execution_time = 300
454 max_input_time = 300
740 post_max_size = 50M
1010 date.timezone = Asia/Chongqing
# php-fpm -t
NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful
# /etc/init.d/php-fpm restart
# cp -rf /root/repo/zabbix-2.4.5/frontends/php /home/wwwroot/zabbix
# cd /home/wwwroot/
# chown -R apache.apache zabbix/
# vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
      ServerName zabbix.xqzh.com
      DocumentRoot /home/wwwroot/zabbix
      <Directory /home/wwwroot/zabbix>
                DirectoryIndex index.php
                Options -Indexes FollowSymLinks
                Order allow,deny
                Allow from all
                AllowOverride None
                AddType application/x-httpd-php .php
</Directory>
</VirtualHost>
# httpd -t
Syntax OK
# /etc/init.d/httpd restart
# chkconfig zabbix_server on
# chkconfig zabbix_agentd on
# /etc/init.d/zabbix_server start
Starting zabbix_server: [ OK ]




zabbix_server : cannot open : Permission denied


1
2
3
4
5
6
7
8
# touch /var/log/zabbix_server.log
# chmod -R 777 /var/log/zabbix_server.log
# /etc/init.d/zabbix_server start
Starting zabbix_server: [ OK ]
# /etc/init.d/zabbix_agentd start
Starting zabbix_agentd: [ OK ]
# netstat -tunlp|grep zabbix   ##查看端口缺少server10051tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 31107/zabbix_agentd
# tail -f /var/log/zabbix_server.log




9871:20150610:160421.477 connection to database 'zabbix' failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
9871:20150610:160421.477 database is down: reconnecting in 10 seconds

1
2
3
4
5
# vim /usr/local/zabbix/etc/zabbix_server.conf
109 DBSocket=/tmp/mysql.sock
# netstat -tunlp|grep zabbix
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 31107/zabbix_agentd
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 23885/zabbix_server




修改C:\Windows\System32\drivers\etc\HOSTS文件
192.168.195.205 zabbix.xqzh.com
浏览器访问:http://zabbix.xqzh.com/
1.Next


2.缺少bcmath


[root@lvsM_195_205 wwwroot]# yum search bcmath
[root@lvsM_195_205 wwwroot]# yum install -y php-bcmath.x86_64
[root@lvsM_195_205 wwwroot]# /etc/init.d/httpd restart
解决之后:retry重新检测然后Next
3.找不到sock

[root@lvsM_195_205 tmp]# ln -s /tmp/mysql.sock /var/lib/mysql/
4.填写zabbix名地址,ip,一路next,安装完成

5.登录页,默认用户名admin,密码:zabbix


页: [1]
查看完整版本: centos6.5安装zabbix2.4.5