centos6.6安装zabbix2.4.5实战
时间:2016-02-27 13:48 来源:51cto 作者:IT
1. 安装前环境准备
[root@zbserver ~]# uname -r
2.6.32-504.el6.x86_64
[root@zbserver ~]# uname -m
x86_64
[root@zbserver ~]# cat/etc/redhat-release
CentOS release 6.6 (Final)
[root@zbserver ~]
# yum -y install wgetvim tree gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysqlhttpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldapphp-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devellibdbi-dbd-mysql net-snmp net-snmp-devel curl-devel
[root@zbserver ~]
# /etc/init.d/httpdstart
[root@zbserver ~]
# /etc/init.d/mysqldstart
[root@zbserver ~]
# chkconfig httpd on
[root@zbserver ~]
# chkconfig mysqld on
iptables -I INPUT -p tcp -m multiport --destination-port 80,10050:10051
[root@zbserver ~]
# cp /etc/php.ini/etc/php.ini.bak_20160226
[root@zbserver ~]
# sed -i "s@;date.timezone=@date.timezone = Asia/Shanghai@g" /etc/php.ini
[root@zbserver ~]
# sed -i"s@max_execution_time = 30@max_execution_time = 300@g" /etc/php.ini
[root@zbserver ~]
# sed -i"s@post_max_size = 8M@post_max_size = 32M@g" /etc/php.ini
[root@zbserver ~]
# sed -i"s@max_input_time = 60@max_input_time = 300@g" /etc/php.ini
[root@zbserver ~]
# sed -i"s@memory_limit = 128M@memory_limit = 128M@g" /etc/php.ini
[root@zbserver ~]
# sed -i"s@;mbstring.func_overload = 0@ambstring.func_overload = 2@g"/etc/php.ini
[root@zbserver ~]
# echo "ServerName localhost:80">>/etc/httpd/conf/httpd.conf
[root@zbserver ~]
# /etc/init.d/httpdrestart
wget http:
//jaist
.dl.sourceforge.net
/project/zabbix/ZABBIX
%20Latest%20Stable
/2
.4.5
/zabbix-2
.4.5.
tar
.gz
[root@zbserver ~]
# groupadd -g 201zabbix
[root@zbserver ~]
# useradd -g zabbix -u201 -s /sbin/nologin zabbix
[root@zbserver ~]
# tar xfzabbix-2.4.5.tar.gz
[root@zbserver ~]
# cd zabbix-2.4.5
[root@zbserver zabbix-2.4.5]
#./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy--enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp--with-libcurl
[root@zbserver zabbix-2.4.5]
# make&& make install
[root@zbserver zabbix-2.4.5]
# mysql -e"create database zabbix default charset utf8;"
[root@zbserver zabbix-2.4.5]
# mysql -e"grant all on zabbix.* to zabbix@localhost identified by 'zabbix';"
[root@zbserver zabbix-2.4.5]
# mysql-uzabbix -pzabbix zabbix<./database/mysql/schema.sql
[root@zbserver zabbix-2.4.5]
# mysql-uzabbix -pzabbix zabbix<./database/mysql/images.sql
[root@zbserver zabbix-2.4.5]
# mysql-uzabbix -pzabbix zabbix<./database/mysql/data.sql
[root@zbserver zabbix-2.4.5]
# mkdir/var/log/zabbix
[root@zbserver zabbix-2.4.5]
# chownzabbix.zabbix /var/log/zabbix
[root@zbserver zabbix-2.4.5]
# ln -s/usr/local/zabbix/etc/ /etc/zabbix
[root@zbserver zabbix-2.4.5]
# ln -s/usr/local/zabbix/bin/* /usr/bin/
[root@zbserver zabbix-2.4.5]
# ln -s/usr/local/zabbix/sbin/* /usr/sbin/
[root@zbserver zabbix-2.4.5]
# cp/root/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_* /etc/init.d
[root@zbserver zabbix-2.4.5]
# chmod 755 /etc/init.d/zabbix_*
[root@zbserver zabbix-2.4.5]
# sed -i"s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g"/etc/init.d/zabbix_server
[root@zbserver zabbix-2.4.5]
# sed -i"s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g"/etc/init.d/zabbix_agentd
sed
-i
"s@DBUser=root@DBUser=zabbix@g"
/etc/zabbix/zabbix_server
.conf
sed
-i
"s@#DBPassword=@DBPassword=zabbix@g"
/etc/zabbix/zabbix_server
.conf
sed
-i
"s@#DBPassword=@DBPassword=zabbix@g"
/etc/zabbix/zabbix_server
.conf
sed
-i
"s@Server=127.0.0.1@Server=127.0.0.1,192.168.0.131@g"
/etc/zabbix/zabbix_agentd
.conf
sed
-i
"s@ServerActive=127.0.0.1@ServerActive=192.168.0.131:10051@g"
/etc/zabbix/zabbix_agentd
.conf
sed
-i
"s@tmp/zabbix_agentd.log@var/log/zabbix/zabbix_agentd.log@g"
/etc/zabbix/zabbix_agentd
.conf
sed
-i
"s@^#UnsafeUserParameters=0@UnsafeUserParameters=1\n@g"
/etc/zabbix/zabbix_agentd
.conf
[root@zbserver zabbix-2.4.5]
# cp -r/root/zabbix-2.4.5/frontends/php/ /var/www/html/zabbix/
[root@zbserver zabbix-2.4.5]
# chown -Rapache.apache /var/www/html/zabbix/
[root@zbserver zabbix-2.4.5]
# chkconfigzabbix_server on
[root@zbserver zabbix-2.4.5]
# chkconfigzabbix_agentd on
[root@zbserver zabbix-2.4.5]
#/etc/init.d/zabbix_server start
Starting zabbix_server: [ OK ]
[root@zbserver zabbix-2.4.5]
# /etc/init.d/zabbix_agentdstart
Starting zabbix_agentd: [ OK ]
[root@zbserver zabbix-2.4.5]
# vim/var/www/html/zabbix/include/defines.inc.php
#修改如下2行
define(
'ZBX_FONT_NAME'
,
'simkai'
);
define(
'ZBX_GRAPH_FONT_NAME'
,
'simkai'
);
[root@zbclient ~]
# yum install wget vimtree gcc gcc-c++ -y
[root@zbclient ~]
# groupadd -g 201zabbix
[root@zbclient ~]
# useradd -g zabbix -u201 -s /sbin/nologin zabbix
[root@zbclient ~]
# tar xfzabbix-2.4.5.tar.gz
[root@zbclient ~]
# cd zabbix-2.4.5
[root@zbclient zabbix-2.4.5]
#./configure --prefix=/usr/local/zabbix --enable-agent
[root@zbclient zabbix-2.4.5]
# make&& make install
[root@zbclient zabbix-2.4.5]
# mkdir/var/log/zabbix
[root@zbclient zabbix-2.4.5]
# chownzabbix.zabbix /var/log/zabbix
[root@zbclientzabbix-2.4.5]
#cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/
[root@zbclient zabbix-2.4.5]
# chmod 755/etc/init.d/zabbix_agentd
[root@zbclient zabbix-2.4.5]
#sed -i"s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g"/etc/init.d/zabbix_agentd
[root@zbclient zabbix-2.4.5]
# ln -s/usr/local/zabbix/etc/ /etc/zabbix
[root@zbclient zabbix-2.4.5]
# ln -s/usr/local/zabbix/bin/* /usr/bin
[root@zbclient zabbix-2.4.5]
# ln -s/usr/local/zabbix/sbin/* /usr/sbin/
[root@zbclient zabbix-2.4.5]
#sed -i "s@Server=127.0.0.1@Server=192.168.0.131@g"/etc/zabbix/zabbix_agentd.conf
[root@zbclient zabbix-2.4.5]
#sed -i "s@ServerActive=127.0.0.1@ServerActive=192.168.0.131:10051@g"/etc/zabbix/zabbix_agentd.conf
[root@zbclient zabbix-2.4.5]
#sed -i"s@tmp/zabbix_agentd.log@var/log/zabbix/zabbix_agentd.log@g" /etc/zabbix/zabbix_agentd.conf
[root@zbclient zabbix-2.4.5]
#sed -i "s@^# UnsafeUserParameters=0@UnsafeUserParameters=1\n@g"/etc/zabbix/zabbix_agentd.conf
[root@zbclient zabbix-2.4.5]
# chkconfigzabbix_agentd on
[root@zbclient zabbix-2.4.5]
#/etc/init.d/zabbix_agentd start
Starting zabbix_agentd: [ OK ]
(责任编辑:IT)
1. 安装前环境准备
[root@zbserver ~]# uname -r 2.6.32-504.el6.x86_64 [root@zbserver ~]# uname -m x86_64 [root@zbserver ~]# cat/etc/redhat-release CentOS release 6.6 (Final)
|