zabbix安装笔记
操作系统
linux RedHat as 5
软件环境
Apache2.2
Php5
Mysql5
Zabbix1.6
软件安装
Apache2.2
下载:http://archive.apache.org/dist/httpd
chmod +x xxxxxxx.tar.gz (可执行权限)
tar -zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
Mysql5
下载:http://dev.mysql.com/downloads
mysql-5.0.67-linux-i686.tar.gz
遇到的错误
Starting MySQL..Manager of pid-file quit without updating f[失败] 删除 /usr/local/mysql/data/mysql-bin.* 重启 生成mysql系统数据库 FATAL ERROR: Could not find ./bin/my_print_defaults /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
Php5
下载:http://www.php.net/downloads.php
安装前必要的软件包
net-snmp-devel-5.3.1-24.el5.i386.rpm
libxml2-2.6.19.tar.gz
libpng-1.2.8.tar.gz
libjpeg-6b.tar.gz
freetype-2.2.1.tar.gz
curl-7.15.0.tar.gz
zlib-1.2.3.tar.gz
libiconv-1.9.2.tar.gz
gd-2.0
openssl
先查询是不是有了这些包
rpm -qa | grep xxxx
遇到的错误
libphp5.so: cannot restore segment prot after reloc: Permission denied #chcon -t texrel_shlib_t libphp5.so libmysqlclient.so.15: cannot restore segment #chcon –t texrel_shlib_t /usr/local/mysql/lib/libmysqlclient.so.15 Notice: Following unknown configure options were used: --with-jpeg --with-png --with-freetype --with-libxml --with-crul 路径问题 查看帮助 ./configure --help
编辑phpinfo.php
<?php
phpinfo();
?>
修改httpd.conf 添加
AddType application/x-httpd-php .php .phtml .php4 .inc
DirectoryIndex index.php
启动Apache
看到php信息表示完成
怪问题 php.ini 修改了max_execution_time 没有反映
php.ini路径不对.......
cp /usr/local/php5/lib/php/php.ini /usr/local/php5/lib
就好了
安装zabbix1.6
导入数据
/usr/local/mysql/bin/mysql -uroot -p<password>
mysql> create database zabbix;
mysql> quit;
shell> cd create/schema
shell> cat mysql.sql | /usr/local/mysql/bin/mysql -u<username> -p<password> zabbix
shell> cd ../data
shell> cat data.sql | /usr/local/mysql/bin/mysql -u<username> -p<password> zabbix
shell> cat images_mysql.sql | /usr/local/mysql/bin/mysql -u<username> -p<password> zabbix
zabbix 设置
vi /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 vi /etc/zabbix/zabbix_server.conf ListenPort=10051 DBHost=localhost DBName=zabbix DBUser=root DBPassword= DBSocket=/tmp/mysql.sock vi /etc/init.d/zabbix_server_ctl # base zabbix dir BASEDIR=/etc/zabbix # PID file PIDFILE=/var/tmp/zabbix_server.pid # binary file ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server
配置文件
mkdir /etc/zabbix
chown -R zabbix.zabbix /etc/zabbix/
cp misc/conf/zabbix_* /etc/zabbix/
复制启动程序
cp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/
cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/
复制zabbix
mkdir /usr/local/apachew/htdocs/zabbix
cp -Rpf frontends/php/* /usr/local/apachew/htdocs/zabbix
自启动
chkconfig --add zabbix-server
chkconfig --add zabbix-agent
chkconfig zabbix-server on
chkconfig zabbix-agent on
例 :
Apache 在系统运行级别3,4,5自动启动
错误集
登陆
http://IP/zabbix
Admin/zabbix
是个很不错的工具,用了一天的时间安装。出了很多错误,好多忘记记下来了.... 悔.....
想起来再修改
接下来就是用好它