自己写的,详细的zabbix安装文档!
www.zabbix.com
http://www.zabbix.com/documentation/1.8/complete
http://www.zabbix.com/wiki/start
zabbix由2部分构成,zabbix server与可选组件zabbix agent。
zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux, Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X等平台之上。
zabbix agent需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有关的内存,CPU等信息的收集。zabbix agent可以运行在Linux ,Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X, Tru64/OSF1, Windows NT4.0, Windows 2000/2003/XP/Vista)等系统之上。
zabbix server可以单独监视远程服务器的服务状态;同时也可以与zabbix agent配合,可以轮询zabbix agent主动接收监视数据(trapping方式),同时还可被动接收zabbix agent发送的数据(trapping方式)。
另外zabbix server还支持SNMP (v1,v2),可以与SNMP软件(例如:net-snmp)等配合使用。
软件需求:
Software Version Comments
Apache 1.3.12 or later
PHP 5.0 or later
PHP moduleshp-gd GD 2.0 or later PHP GD module must support PNG images.
PHP TrueType support --with-ttf
PHP bc support php-bcmath, --enable-bcmath
PHP XML support php-xml or php5-dom, if provided as a separate package by the distributor
PHP session support php-session, if provided as a separate package by the distributor
PHP socket support php-net-socket, --enable-sockets. Required for user script support.
PHP multibyte support php-mbstring, --enable-mbstring
MySQL php-mysql 3.22 or later Required if MySQL is used as Zabbix back end database.
①环境
yum -y install gcc mysql-server httpd php php-mysql php-gd php-bcmath php-xml php-mbstring mysql-devel php-snmp net-snmp-devel net-snmp net-snmp-utils OpenIPMI-devel curl-devel
②下载解压
wget http://prdownloads.sourceforge.n ... 8.2.tar.gz?download
tar zxvf zabbix-1.8.2.tar.gz
③配置zabbix数据库
useradd zabbix
cd zabbix-1.8.2
\cp -rf /usr/share/doc/mysql-server-5.0.77/my-medium.cnf /etc/my.cnf
mysql_install_db --user=mysql
/etc/init.d/mysqld start
进入数据库:
mysql -u root -p
create database zabbix character set utf8;
grant all on zabbix.* to zabbix@localhost identified by 'zabbixpwd';
quit
退出数据库
mysql -uzabbix -pzabbixpwd zabbix < create/schema/mysql.sql
mysql -uzabbix -pzabbixpwd zabbix < create/data/data.sql
mysql -uzabbix -pzabbixpwd zabbix < create/data/images_mysql.sql
④编译安装zabbix
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-openipmi && \
make && \
make install
⑤zabbix服务配置
* 服务端口定义:
编辑 /etc/services,在后面追加:
cat >> /etc/services << "EOF"
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
EOF
* 复制配置文件:
mkdir /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix/
cp misc/conf/zabbix_proxy.conf /etc/zabbix/
cp misc/conf/zabbix_agent.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
* 修改 zabbix server 配置文件 /etc/zabbix/zabbix_server.conf 中的数据库用户名和密码:
sed -i '95s/root/zabbix/' /etc/zabbix/zabbix_server.conf
sed -i '103a\DBPassword=zabbixpwd' /etc/zabbix/zabbix_server.conf
* 安装启动脚本
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
* 修改 /etc/init.d/zabbix_server 变量定义:
sed -i '19s#opt#usr/local#' /etc/init.d/zabbix_server
sed -i '25s#bin#sbin#' /etc/init.d/zabbix_server
* 修改 /etc/init.d/zabbix_agentd 变量定义:
sed -i '19s#opt#usr/local#' /etc/init.d/zabbix_agentd
sed -i '25s#bin#sbin#' /etc/init.d/zabbix_agentd
* 启动 Zabbix Server:
/etc/init.d/zabbix_server start
* 启动 Zabbix Agentd
/etc/init.d/zabbix_agentd start
* 配置WEB,复制 Web Interface 到 web 目录:
cp -r frontends/php/* /var/www/html/
/etc/init.d/httpd start
⑥WEB配置zabbix
打开 http://localhost/,看到提示:
Timezone for PHP is not set. Please set "date.timezone" option in php.ini.
按照提示,修改 php.ini 中时区设置:
date.timezone = Asia/Shanghai
service httpd restart
依次单击下一步,在环境检测时会看到几个fail,再次修改 php.ini,根据提示设置相应参数:
post_max_size = 32M
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
upload_max_filesize = 32M
Current value Required Recommended
PHP version 5.1.6 5.0 5.3.0 Ok
PHP memory limit 16M 128M 256M Fail
PHP post max size 8M 16M 32M Fail
PHP upload max filesize 2M 2M 16M Ok
PHP max execution time 30 300 600 Fail
PHP max input time 60 300 600 Fail
PHP timezone Asia/Shanghai Ok
PHP databases support MySQL Ok
PHP BC math yes Ok
PHP MB string yes Ok
PHP Sockets yes Ok
PHP GD 2.0.28 2.0 2.0.34 Ok
GD PNG Support yes Ok
libxml module 2.6.26 2.6.15 2.7.6 Ok
ctype module yes Ok
解决后按提示继续安装即可。
⑦结束:
安装完后直接访问:
http://localhost/
默认用户名和密码是:
admin/zabbix
客户端安装配置:
①环境
yum -y install gcc
②下载解压
tar zxf zabbix-1.8.2.tar.gz
③配置zabbix用户
useradd zabbix
cd zabbix-1.8.2
④编译安装zabbix
./configure --prefix=/usr/local/zabbix --enable-agent && \
make && \
make install
⑤zabbix服务配置
* 服务端口定义:
编辑 /etc/services,在后面追加:
cat >> /etc/services << "EOF"
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
EOF
* 复制配置文件:
mkdir /etc/zabbix
cp misc/conf/zabbix_agent.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
* 修改配置文件:
vi /etc/zabbix/zabbix_agent.conf
Server=192.168.168.100
vi /etc/zabbix/zabbix_agentd.conf
Server=192.168.168.100
Hostname=server30
* 安装启动脚本
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
chmod a+x /etc/init.d/zabbix_agentd
* 修改 /etc/init.d/zabbix_agentd 变量定义:
BASEDIR=/usr/local/zabbix
FULLPATH=$BASEDIR/sbin/$BINARY_NAME
* 添加到启动服务:
chkconfig --add zabbix_agentd
* 启动 Zabbix Agentd
/etc/init.d/zabbix_agentd start
©著作权归作者所有:来自51CTO博客作者gslsf223的原创作品,如需转载,请与作者联系,否则将追究法律责任
文档休闲zabbixLinux
共同学习,写下你的评论
评论加载中...
作者其他优质文章