zabbix server:负责接收agent发送的报告信息的核心组件,所有配置,统计数据以及操作数据均由其组织进行。
database storage: 专用于存储所有配置信息,以及由zabbix收集的数据
web interface:zabbix 的GUI 接口,通常与server 运行在一台主机上。
proxy:可选组件,用于分布式监控环境中,代理server 收集部分被监控的监控数据并统一发往server 端。
agent:部署在被监控主机上,负责收集本地数据发往server 端或porxy端。
系统:centos 6.4
zabbix-server:192.168.1.19
mysql-server:192.168.1.18
下载rpm包:
[[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-get-2.2.4-1.el6.x86_64.rpm [[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-server-2.2.4-1.el6.x86_64.rpm [[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-2.2.4-1.el6.x86_64.rpm [[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-web-2.2.4-1.el6.noarch.rpm [[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-server-mysql-2.2.4-1.el6.x86_64.rpm [[email protected] ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-web-mysql-2.2.4-1.el6.noarch.rpm
安装EPEL:
[[email protected] ~]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm [[email protected] ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
安装zabbix 服务端
[[email protected] ~]# yum localinstall *.rpm -y [[email protected] ~]# scp /usr/share/doc/zabbix-server-mysql-2.2.4/create/*.sql 192.168.1.18:/root
mysql服务器上安装 配置mysql:
[[email protected] ~]# yum install bison gcc gcc-c++ autoconf automake ncurses-devel cmake make openssl openssl-devel [[email protected] ~]# mkdir -p /mydata/data;groupadd -r mysql [[email protected] ~]# useradd -g mysql -r -d /mydata/data mysql [[email protected] ~]# tar -zxvf mysql-5.5.35.tar.gz [[email protected] ~]# cd mysql-5.5.35 [[email protected] mysql-5.5.35]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mydata/data -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE=1 -DWITH_ARCHIVE_STORAGE=1 -DWITH_BLACKHOLE_STORAGE=1 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci [[email protected] mysql-5.5.35]# make && make install [[email protected] mysql-5.5.35]# cd /usr/local/mysql [[email protected] mysql]# cp supports-file/my-large.cnf /etc/my.cnf [[email protected] mysql]# cp supports-file/mysql.server /etc/rc.d/init.d/mysqld [[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data [[email protected] mysql]# /etc/init.d/mysqld start [[email protected] mysql]# chkconfig -add mysqld [[email protected] mysql]# vim /etc/profile.d/mysql.sh export PATH=$PATH:/usr/local/mysql/bin [[email protected] mysql]# source /etc/profile [[email protected] mysql]# mysqladmin -uroot password ‘redhat‘ [[email protected] mysql]# mysql -uroot -predhat -e "create database zabbix;" [[email protected] ~]# mysql -uroot -predhat zabbix < schema.sql [[email protected] ~]# mysql -uroot -predhat zabbix < images.sql [[email protected] ~]# mysql -uroot -predhat zabbix < data.sql
授权zabbix用户:
mysql> grant all on zabbix.* to ‘zbxuser‘@‘192.168.%.%‘ identified by ‘redhat‘; mysql> flush privileges;
zabbix 服务端:
[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=192.168.1.18 DBName=zabbix DBUser=zbxuser DBPassword=redhat DBSocket=/tmp/mysql.sock SNMPTrapperFile=/var/log/snmptt/snmptt.log AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts [[email protected] ~]# /etc/init.d/zabbix-server start [[email protected] ~]# netstat -nltpu | grep 10051 [[email protected] ~]#vim /etc/php.ini date.timezone = Asia/Shanghai [[email protected] ~]# /etc/init.d/httpd start
最后通过 http://192.168.1.19/zabbix/ 来配置
http://192.168.1.19/zabbix/index.php#
username:admin
password:zabbix (默认)
下一节介绍zabbix agent的相关监控配置。
zabbix系列(一):zabbix server的安装配置
时间: 2024-10-12 15:19:29