第一步:
http://www.iyunv.com/thread-41703-1-1.html
http://www.osyunwei.com/archives/7984.html
http://www.centoscn.com/image-text/install/2015/0827/6071.html
yum install php php-gd php-mysql php-bcmath php-mbstring php-xml curl curl-devel net-snmp net-snmp-devel perl-DBI
yum install httpd mariadb*
#systemctl start mariadb.service
# mysql -u root -p
Enter password:
create database zabbix character set utf8;
insert into mysql.user(Host,User,Password) values('localhost','zabbix',password('zabbix'));
grant all on zabbix.* to 'zabbix'@'127.0.0.1' identified by 'zabbix' with grant option;
flush privileges;
# tar -zxvf zabbix-2.4.5.tar.gz
# cd zabbix-2.4.5
# ./configure --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy --prefix=/usr/local/zabbix
--prefix----> 指定zabbix安装目录
--enable-server----> 支持zabbix服务器
--enable-agent----> 支持zabbix代理
--enable-proxy----> 支持zabbix代理服务器
--with-libcurl----> 使用curl包
--with-net-snmp----> 使用net-snmp软件包,选择性地指定路径NET-SNMP配置
--with-mysql=/usr/bin/mysql_config 使用MySQL客户端库可以选择指定路径mysql_config
注:如出现configure: error: MySQL library not found错误,是因为缺少mariadb-devel该软件包,yum install mariadb-devel进行安装
# make
# make install
# mysql -u root -p
use zabbix;
source /opt/wc/zabbix-2.4.5/database/mysql/schema.sql
source /opt/wc/zabbix-2.4.5/database/mysql/data.sql
source /opt/wc/zabbix-2.4.5/database/mysql/images.sql
quit
添加服务器对应的端口(可省略)
# cat /etc/services | grep zabbix
测试zabbix服务启动
# /usr/local/zabbix/sbin/zabbix_agentd //客户端
zabbix_agentd [29191]: user zabbix does not exist
zabbix_agentd [29191]: cannot run as root!
# /usr/lcoal/zabbix/sbin/zabbix_server //服务端
zabbix_agentd [29208]: user zabbix does not exist
zabbix_agentd [29208]: cannot run as root!
第二步:
# cd /usr/local/zabbix/etc
# vi /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ListenIP=127.0.0.1
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts
# vi /usr/local/zabbix/etc/zabbix_agentd.conf
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1
# cp /opt/wc/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
# cp /opt/wc/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
# vi /etc/rc.d/init.d/zabbix_server
BASEDIR=/usr/local/zabbix/
# vi /etc/rc.d/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix/
# service zabbix_agentd start
# service zabbix_server start
cp -r /opt/wc/zabbix-2.4.5/frontends/php /var/www/html/zabbix
http://110.110.110.110:8888/zabbix/setup.php出来配置界面即可
第三步:
# vi /etc/php.ini
post_max_size =16M
max_execution_time =300
max_input_time =300
date.timezone = Asia/Shanghai
# vi /etc/php-fpm.d/www.conf
request_terminate_timeout = 300
# systemctl restart php-fpm.service
# systemctl restart httpd.service(重启php之后执行Retry没用就再执行apache就ok了)
最后一步报错:
Configuration file "/var/www/html/zabbix/conf/zabbix.conf.php" created: Fail
# cd /var/www/html/zabbix/conf
# cp zabbix.conf.php.example zabbix.conf.php
# vi zabbix.conf.php
<?php
global $DB;
$DB["TYPE"] = 'MYSQL';
$DB["SERVER"] = '127.0.0.1';(默认localhost修改)
$DB["PORT"] = '3306';(默认0修改为3306)
$DB["DATABASE"] = 'zabbix';
$DB["USER"] = 'zabbix';
$DB["PASSWORD"] = 'zabbix';(默认修改为自己的密码)
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB["SCHEMA"] = '';
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = '';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>
# 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),
报错1:
zabbix server is not running:the information displayed may not be current
解决1:
参考:(自己还有待实践一下)
http://blog.sina.com.cn/s/blog_4991d72c0102vu5d.html
http://www.centoscn.com/image-text/install/2015/0827/6071.html
http://www.awspack.com/linux/install-zabbix24/
http://www.iyunv.com/thread-19749-1-1.html