zabbix简单安装

zabbix安装

服务器CentOS 6.5

#监控端/服务端

yum install -y gcc gcc-c++ patch make flex bison file libtool libtool-libs autoconf libjpeg-devel libpng libpng-devel gd gd-devel freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel gettext-devel gmp-devel unzip libcap apr* automake openssl openssl-devel perl compat* mpfr cpp glibc glibc-devel libgomp libstdc++-devel ppl cloog-ppl keyutils keyutils-libs-devel libcom_err-devel libsepol-devel krb5-devel libXpm* php-common php-gd pcre-devel openldap net-snmp net-snmp-devel libssh2-devel OpenIPMI-devel unixODBC perl-DBI
wget  -ivh  iksemel-1.4-42.1.x86_64.rpm
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm   #yum安装不上,先安装这玩意
  zabbix文档 
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-agent-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-get-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-sender-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-server-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-server-mysql-2.4.3-1.el6.x86_64.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-web-2.4.3-1.el6.noarch.rpm
wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-web-mysql-2.4.3-1.el6.noarch.rpm
# ls
zabbix-2.4.3-1.el6.x86_64.rpm         zabbix-server-2.4.3-1.el6.x86_64.rpm
zabbix-agent-2.4.3-1.el6.x86_64.rpm   zabbix-server-mysql-2.4.3-1.el6.x86_64.rpm
zabbix-get-2.4.3-1.el6.x86_64.rpm     zabbix-web-2.4.3-1.el6.noarch.rpm
zabbix-sender-2.4.3-1.el6.x86_64.rpm  zabbix-web-mysql-2.4.3-1.el6.noarch.rpm
# yum localinstall *.rpm                 #安装zabbix,同时将会安装php,http
# yum install mysql-server mysql
# rpm -qal|grep zabbix-server            #查看zabbix的数据库文件
/usr/share/doc/zabbix-server-mysql-2.4.3
/usr/share/doc/zabbix-server-mysql-2.4.3/create
/usr/share/doc/zabbix-server-mysql-2.4.3/create/data.sql
/usr/share/doc/zabbix-server-mysql-2.4.3/create/images.sql
/usr/share/doc/zabbix-server-mysql-2.4.3/create/schema.sql
# service mysqld start
# mysql -uroot -p                       #创建zabbix数据库并导入,顺序不要错
mysql> create database zabbix;
mysql> grant all on zabbix.* to zabbixuser@localhost identified by "zabbixpasswd";
mysql> flush privileges;
mysql> use zabbix;
mysql> source /usr/share/doc/zabbix-server-mysql-2.4.3/create/schema.sql
mysql> source /usr/share/doc/zabbix-server-mysql-2.4.3/create/data.sql
mysql> source /usr/share/doc/zabbix-server-mysql-2.4.3/create/images.sql
# cd /etc/zabbix/                       #配置zabbix
# cat zabbix_server.conf|grep -v ^\# |sed '/^$/d'
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=1024
PidFile=/var/run/zabbix/zabbix_server.pid
DBName=zabbix
DBUser=zabbixuser
DBPassword=zabbixpasswd
DBSocket=/var/lib/mysql/mysql.sock
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
# service zabbix-server start
# service zabbix-agent start
# vim /etc/php.ini
;date.timezone =
date.timezone = Asia/Shanghai
# service httpd start
http://192.168.10.1/zabbix/setup.php 浏览器访问
登录用户名admin,密码 zabbix

wKioL1TVuS3Co7hVAAL_druvSPs291.jpg

老提示 zabbix server is not running the information displayed may not be current
# setenforce 0

#被监控端/客户端
# yum localinstall zabbix-2.4.3-1.el6.x86_64.rpm zabbix-agent-2.4.3-1.el6.x86_64.rpm zabbix-sender-2.4.3-1.el6.x86_64.rpm

# grep Server= /etc/zabbix/zabbix_agentd.conf  配置文件Server改为服务端ip
# Server=
Server=192.168.10.1

# service zabbix-agent start

# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT

把zabbix的admin密码改一下吧

Administration -- Users -- Admin (Zabbix Administrator) -- Password

你可能感兴趣的:(安装,监控,zabbix)