数据迁移,我们的Zabbix 也需要挪一挪。。。
软件环境:
Ubuntu 11.10
nginx 1.0.15
php-5.3.16
MySQL 5.1.51
Zabbix-1.8.15
安装步骤:
MySQL,NGINX省去
php安装:
依赖包安装:apt-get install libxml2 libxml2-dev libpng*
php 必须支持 php-gd、php-bcmath、php-xml、php-mysql、php-net-socket、php-mbstring
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --enable-sockets --enable-pdo --with-pdo-mysql=/usr/local/mysql --with-gd --enable-bcmath --enable-xml --enable-mbstring && make && make install
拷贝配置文件
cp /data/php-5.3.19/php.ini-production /usr/local/php/etc/php.ini
修改部分:
date.timezone = 'Asia/Chongqing' post_max_size = 16M max_execution_time = 600 max_input_time = 600
zabbix 安装:
下载:wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.15/zabbix-1.8.15.tar.gz
tar -xzf zabbix-1.8.15.tar.gz
groupadd zabbix;useradd zabbix -g zabbix
数据库修改部分:
create database zabbix character set utf8; grant all on zabbix.* to zabbix@'10.4.6.190' identified by 'xxxxxx'; mysql -uroot -p zabbix < create/schema/mysql.sql mysql -uroot -p zabbix < create/data/data.sql mysql -uroot -p zabbix < create/data/p_w_picpaths_mysql.sql
./configure --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl && make && make install
--enable-server 安装 Zabbix Server
--enable-proxy 安装 Zabbix Proxy
--enable-agent 安装 Zabbix Agent
--with-mysql 使用 mysql 做数据库服务器
--with-net-snmp 支持 SNMP
--with-libcurl 支持 curl,用于 web 监控
(缺少的依赖包:apt-get install libcurl4-gnutls-dev apt-get install libcurl4-openssl-dev apt-get install net-snmp* apt-get install libsnmp-dev)
编辑 /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
配置文件复制:
mkdir /etc/zabbix cp misc/conf/zabbix_server.conf /etc/zabbix/ cp misc/conf/zabbix_proxy.conf /etc/zabbix/ cp misc/conf/zabbix_agent.conf /etc/zabbix/ cp misc/conf/zabbix_agentd.conf /etc/zabbix/
/etc/zabbix/zabbix_server.conf
修改数据库连接设置:
DBUser=zabbix
DBPassword=zabbix
DBHost=10.4.3.163
安装启动脚本
cp misc/init.d/gentoo/zabbix-server /etc/init.d/ cp misc/init.d/gentoo/zabbix-agentd /etc/init.d/ chmod +x /etc/init.d/zabbix-server chmod +x /etc/init.d/zabbix-agentd
nginx 配置文件:
server { listen 80; server_name zabbix.sigh.com.cn; client_max_body_size 10M; access_log /data/zabbix_php/zabbix.log main; error_log /data/zabbix_php/zabbix_error.log warn; location / { root /work/www/zabbix/php; index index.html index.htm index.php; } location ~ \.php$ { root /work/www/zabbix; fastcgi_pass 127.0.0.1:8999; fastcgi_param SCRIPT_FILENAME /work/www/zabbix$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } }
启动php-fpm。
默认用户名和密码是:Admin/zabbix;
安装FAQ:
1 configure: error: MySQL library not found the problem is not installed mysql-devel #apt-get install libghc6-hsql-mysql-dev (ubuntu ) 2 configure: error: Jabber library not found the problem is not installed jabber lib #apt-get install libphp-jabber #apt-get install libnet-jabber-loudmouth-perl #apt-get install jabber-dev #apt-get install libiksemel-dev 3 configure: error: Not found curlLibrary the problem is not installed libcurl4-openssl-dev #apt-get install libcurl4-openssl-dev 4 configure: error : Not found NET-SNM library #apt-get install libsnmp-dev #apt-get install snmp