zabbix服务端安装部署
1.安装LAMP环境,此处具体步骤略,可以使用yum安装。2.安装zabbix必备软件
yum -y install net-snmp-devel curl-devel
3.安装zabbix server
(1)解压安装包
tar zxvf zabbix-1.8.9.tar.gz
(2)添加zabbix用户
groupadd zabbix
useradd zabbix -g zabbix
(3)为zabbix创建数据库并添加用户
mysql -uroot -p123.com -e "create database zabbix character set utf8;"
mysql -uroot -p123.com -e "grant all on zabbix.* to zabbix@localhost identified by '123.com';"
(4)将软件中的zabbix数据导入到数据库中
mysql -uzabbix -p123.com zabbix < create/schema/mysql.sql
mysql -uzabbix -p123.com zabbix < create/data/data.sql
mysql -uzabbix -p123.com zabbix < create/data/images_mysql.sql
(5)编译安装软件
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl
make && make install
(6)为zabbix server添加端口
cat>>/etc/service /etc/ld.so.conf
ldconfig
(10)拷贝相应的web程序到相关WEB服务目录下
cp -r frontends/php /data/www/wwwroot/zabbix
(11)拷贝必要的zabbix服务端和客户端启动脚本到启动目录/etc/init.d目录下,并进行相应修改
cp misc/init.d/redhat/8.0/zabbix_server /etc/init.d/
chmod a+x /etc/init.d/zabbix_server
cp misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d/
chmod a+x /etc/init.d/zabbix_agentd
sed -i 's/^progdir=.*$/progdir="\/usr\/local\/zabbix\/sbin\/"/g' /etc/init.d/zabbix_server
sed -i 's/^progdir=.*$/progdir="\/usr\/local\/zabbix\/sbin\/"/g' /etc/init.d/zabbix_agentd
(12)启动zabbix服务端程序
service zabbix-server start
(13)添加开机启动服务程序
chkconfig --add zabbix_server
chkconfig --add zabbix_agentd
chkconfig --level 345 zabbix_server on
chkconfig --level 345 zabbix_agentd on
(14)在httpd中设置主目录
更改主目录
DocumentRoot "/var/www/html/zabbix"
更改默认索引页
DirectoryIndex index.php index.html index.html.var
(15)修改PHP配置文件php.ini内容使其满足zabbix安装配置需求
sed -i 's/^\(.*\)date.timezone =.*$/date.timezone = Asia\/Shanghai/g' /usr/local/php5.2.14/etc/php.ini
sed -i 's/^\(.*\)post_max_size =.*$/post_max_size = 16M/g' /usr/local/php5.2.14/etc/php.ini
sed -i 's/^\(.*\)max_execution_time =.*$/max_execution_time = 300/g' /usr/local/php5.2.14/etc/php.ini
sed -i 's/^\(.*\)max_input_time =.*$/max_input_time = 300/g' /usr/local/php5.2.14/etc/php.ini
4.配置web安装界面
(1)在浏览器中打开刚刚配置好的zabbix,系统会直接进入zabbix安装界面
http://blog.运维网.com/attachment/201203/151337641.jpg(2)Next下一步后选择I agree进如下一步
(3)修改PHP配置文件php.ini中以下参数的配置,使其满足zabbix的软件安装要求后重新启动httpd
http://blog.运维网.com/attachment/201203/151446664.jpg
(4)配置数据库相关参数,并testconnection使其OK
http://blog.运维网.com/attachment/201203/151801742.jpg
(5)修改zabbix服务端主机名IP和服务端口
http://blog.运维网.com/attachment/201203/151856722.jpg
6)将zabbix生成的配置文件zabbix.conf.php另存为到本地,然后上传至zabbix网站目录下配置文件目录/data/www/wwwroot/zabbix/conf下,之后Retry刷新下。出现OK后,点击Next完成配置http://blog.运维网.com/attachment/201203/151954439.jpg
5.完成配置。
页:
[1]