zabbix分布式监控系统 (1)

zabbix简介:

zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。

zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。

zabbix由2部分构成,zabbix server与可选组件zabbix agent。

zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上。

Alexei Vladishev创建了Zabbix项目,当前处于活跃开发状态,Zabbix SIA提供支持.

Zabbix是一个企业级的、开源的、分布式的监控套件

Zabbix可以监控网络和服务的监控状况. Zabbix利用灵活的告警机制,允许用户对事件发送基于Email的告警. 这样可以保证快速的对问题作出相应. Zabbix可以利用存储数据提供杰出的报告及图形化方式. 这一特性将帮助用户完成容量规划.

Zabbix支持polling和trapping两种方式. 所有的Zabbix报告都可以通过配置参数在WEB前端进行访问. Web前端将帮助你在任何区域都能够迅速获得你的网络及服务状况. Zabbix可以通过尽可能的配置来扮演监控你的IT基础框架的角色,而不管你是来自于小型组织还是大规模的公司.

Zabbix是零成本的. 因为Zabbix编写和发布基于GPL V2协议. 意味着源代码是免费发布的.

Zabbix公司也提供商业化的技术支持.

zabbix的特性:

(1)安装与配置简单。
(2)可视化web管理界面。
(3)免费开源。
(4)支持中文。
(5)自动发现。
(6)分布式监控。
(7)实时绘图。

环境说明:

check1为master,check2和check3为分布式slave

[root@check2 ~]# cat /etc/redhat-release 
CentOS release 6.9 (Final)
[root@check2 ~]# uname -a
Linux check2 2.6.32-696.16.1.el6.x86_64 #1 SMP Wed Nov 15 16:51:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

一、zabbix安装

Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源,将PHP升级到5.4以上,注意,不支持PHP7

[root@check2 ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
[root@check2 ~]# yum -y install php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
[root@check2 ~]# vim /etc/php.ini
889 date.timezone = Asia/Shanghai
663 post_max_size = 32M
375 max_execution_time = 300
385 max_input_time = 300
705 always_populate_raw_post_data = -1

安装数据库

[root@check2 ~]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
[root@check2 ~]# yum -y install mysql-server mysql-devel
[root@check2 ~]# rpm -qa | grep mysql*
mysql-community-common-5.6.40-2.el6.x86_64
mysql-community-client-5.6.40-2.el6.x86_64
mysql-community-server-5.6.40-2.el6.x86_64
mysql-community-libs-5.6.40-2.el6.x86_64
mysql-community-release-el6-5.noarch
mysql-community-devel-5.6.40-2.el6.x86_64
php56w-mysql-5.6.35-1.w6.x86_64
mysql-community-libs-compat-5.6.40-2.el6.x86_64
[root@check2 ~]# vim /etc/my.cnf
[mysqld]
innodb_file_per_table      #独立表空间模式
[root@check2 ~]# service mysqld start
[root@check2 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE
! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): “初次运行,直接回车” OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] y “是否设置数据库root密码” New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] 是否删除匿名用户,生产环境建议删除,回车即删除 ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y 是否禁止root远程登录,根据自己的需求选择,建议禁止 ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] 是否删除测试数据库,直接回车 - Dropping test database... ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist ... Failed! Not critical, keep moving... - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] 是否重新加载权限表,直接回车 ... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up... 如果上面没有设置密码,可用以下命令进行设置 [root@check2 ~]# mysqladmin -u root password [root@check2 ~]# mysql -u root -p Enter password: mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> show databases; +-------------------------------+ | Database | +-------------------------------+ | information_schema | | mysql | | performance_schema | | zabbix | +-------------------------------+ 4 rows in set (0.00 sec)

猜你喜欢

转载自www.cnblogs.com/LuckWJL/p/9037007.html