Linux系统-zabbix监控软件的安装及布署
Linux系统——zabbix监控软件安装布署zabbix安装需要LAMP或LNMP环境,并且对这些软件的版本也有一定的要求,并且PHP编译安装时需要一些指定 的模块,否则可能会安装不上,具体需求请参考官方文档1、安装系统环境说明# cat /etc/redhat-releaseCentOS release 6.5 (Final)# uname -r2.6.32-431.el6.x86_64Apache版本# ls -ld /application/apachelrwxrwxrwx. 1 root root 25 Sep 12 03:44 /application/apache -> /application/apache2.4.23MySQL版本# ls -ld /application/mysql-5.1.73drwxr-xr-x. 11 mysql mysql 4096 Sep 19 09:16 /application/mysql-5.1.73PHP版本# /application/php/bin/php -vPHP 5.3.27 (cli) (built: Nov 15 2016 13:03:18) Copyright (c) 1997-2013 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies安装一些必要的包软件yum install net-snmp net-snmp-devel libcurl-devel -y2、下载安装zabbix软件创建用户# groupadd zabbix# useradd -g zabbix zabbix下载软件wget zabbix/zabbix-2.4.8.tar.gz
编译安装./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-net-snmp --with-mysql=/application/mysql-5.1.73/bin/mysql_config --with-libcurlConfiguration:Detected OS: linux-gnuInstall path: /usr/local/zabbixCompilation arch: linuxCompiler: gccCompiler flags: -g -O2-I/application/mysql-5.1.73/include/mysql-g -DUNIV_LINUX -I/usr/include/rpm -I/usr/local/include -I/usr/lib64/perl5/CORE -I. -I/usr/include Enable server: yesServer details: With database: MySQL WEB Monitoring: cURL Native Jabber: no SNMP: yes IPMI: no SSH: no ODBC: noLinker flags: -rdynamic-L/application/mysql-5.1.73/lib/mysql -L/usr/lib64 Libraries: -lm -ldl -lrt-lresolv -lmysqlclient -lnetsnmp -lcurlEnable proxy: noEnable agent: yes Agent details:Linker flags: -rdynamic Libraries: -lm -ldl -lrt-lresolv -lcurlEnable Java gateway: noLDAP support: noIPv6 support: no************************************************************ Now run 'make install' ** ** Thank you for using Zabbix! ** <h > ************************************************************# tar zxf zabbix-2.4.8.tar.gz #cd zabbix-2.4.8#./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-net-snmp --with-mysql=/application/mysql-5.1.73/bin/mysql_config --with-libcurl# make && make install3、配置zabbix配置启动文件# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
# cp misc/init.d/tru64/zabbix_agentd /etc/init.d/# chmod 755 /etc/init.d/zabbix_server# chmod 755 /etc/init.d/zabbix_agentd拷贝配置文件到WEB目录下# cp -r frontends/php /application/apache/htdocs/zabbix创建数据库与用户mysql> create database zabbix default charset utf8;Query OK, 1 row affected (0.00 sec)mysql> grant all on zabbix.* to zabbixuser@localhost identified by 'zabbixuser';Query OK, 0 rows affected (0.06 sec)mysql> flush privileges;Query OK, 0 rows affected (0.06 sec)初始化数据库
# mysql zabbix <./database/mysql/schema.sql# mysql zabbix <./database/mysql/images.sql# mysql zabbix <./database/mysql/data.sql修改配置文件vi /etc/init.d/zabbix_agentdDAEMON=/usr/local/zabbix-2.4.8/sbin/zabbix_agentd# egrep -v "^#.*|^$" zabbix_server.confListenPort=10051LogFile=/tmp/zabbix_server.logDebugLevel=4PidFile=/tmp/zabbix_server.pidDBHost=localhostDBName=zabbixDBUser=zabbixuserDBPassword=zabbixuserDBSocket=/tmp/mysql.sockDBPort=3306StartPollers=15StartIPMIPollers=15StartPingers=2StartDiscoverers=2StartHTTPPollers=2启动服务# /etc/init.d/zabbix_server startStarting zabbix_server:/etc/init.d/functions: line 546: /usr/local/sbin/zabbix_server: No such file or directory 修改启动文件
# vi /etc/init.d/zabbix_server +546#!/bin/bash## chkconfig: - 90 10# description:Starts and stops Zabbix Server using chkconfig# Tested on Fedora Core 2 - 5# Should work on all Fedora Core versions## @name: zabbix_server# @author: Alexander Hagenah <hagenah@topconcepts.com># @created: 18.04.2006## Modified for Zabbix 2.0.0# May 2012, Zabbix SIA## Source function library.. /etc/init.d/functions# Variables# Edit these to match your system settings # Zabbix-Directory BASEDIR=/usr/local 修改成BASEDIR=/usr/local/zabbix # Binary File BINARY_NAME=zabbix_server# /etc/init.d/zabbix_server startStarting zabbix_server: 4、打开浏览器进行相关设置需要修改php.ini文件post_max_size = 16Mmax_execution_time = 300max_input_time = 300date.timezone = Asia/Shanghai进入php的源码目录下切换到mysqli模块下# cd mysqli# /application/php/bin/phpizeConfiguring for:PHP Api Version: 20090626Zend Module Api No: 20090626Zend Extension Api No: 220090626# ./configure --prefix=/usr/local/mysqli --with-php-config=/application/php/bin/php-config --with-mysqli=/application/mysql-5.1.73/bin/mysql_config# make && make install# cd ../# cd bcmath/# /application/php/bin/phpize Configuring for:PHP Api Version: 20090626Zend Module Api No: 20090626Zend Extension Api No: 220090626# ./configure --prefix=/usr/local/bcmath --with-php-config=/application/php/bin/php-config# make && make install # cd ../# cd gettext/# /application/php/bin/phpize Configuring for:PHP Api Version: 20090626Zend Module Api No: 20090626Zend Extension Api No: 220090626# ./configure --prefix=/usr/local/gettext --with-php-config=/application/php/bin/php-config# make && make install # ll /application/php-5.3.27/lib/php/extensions/no-debug-zts-20090626/total 728-rwxr-xr-x 1 root root 145372 Nov 15 15:17 bcmath.so-rwxr-xr-x 1 root root42037 Nov 15 15:18 gettext.so-rwxr-xr-x 1 root root 549483 Nov 15 15:15 mysqli.so修改php.ini文件未行加上模块extension=mysqli.soextension=bcmath.soextension=gettext.so重启httpd服务
错误解决了下一步即可填写数据库信息这里点击下载配置文件,然后上传到站点目录下,Retry即可默认用户:Admin 密码:zabbix登陆成功,至此所有安装结束原创: 民工哥
页:
[1]