Centos 7 安装zabbix3.0

前端之家收集整理的这篇文章主要介绍了Centos 7 安装zabbix3.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我是初学者,不会编译安装只能使用yum安装以下教程

以下有说错的地方请给位看完纠正一下,谢谢各位。

Install Zabbix 3.0 (Monitoring Server) on CentOS 7.x

Zabbix is a free and open source monitoring tool which is used to monitor and track the availability & performance of servers,network devices and other IT assets which are on network.

Zabbix uses database like MysqL,MariaDB,Oracle and IBM DB2 to store its data. Zabbix web interface is written in PHP.


Some of its key features are listed below :

  • Monitor everything which is on network like Servers,applications,database instance and network devices.

  • Zabbix provides Web based administration interface.

  • Monitoring cpu utilization of a particular process or a group of process ( proc.cpu.util)

  • Using low-level discovery rules,zabbix can discover Vmware hypervisor ( ESXI ) and Virtual machines.

  • Zabbix also supports agentless monitoring

  • Monitoring of database servers like MysqL,Postgresql,Oracle and Microsoft sql Server.

  • Zabbix can also perform the task of capacity planning for your environment.

  • Zabbix is Open Source so no cost involved and can be deployed on small and large environment.

  • Hardware Monitoring using Zabbix via IPMI credentials.

  • Network Device monitoring using snmp agents.

这是我安装zabbix的系统及网络环境

  • Hostname = zabbix.localhost

  • IP Address = 192.168.12.131

  • OS = CentOS 7.x

开始安装前先更新一下现有系统

[root@zabbix~]#yum-yupdate
[root@zabbix~]#reboot

第一步启用EPEL zabbix 库

Zabbix package is not available in the default yum repository,so we will enable zabbix and epel repository using below commands.

[root@zabbix~]#yuminstallepel-release
[root@zabbix~]#rpm-ivhhttp://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

第二步安装zabbix Server,database(数据库)Web服务器我使用的是Apache PHP

使用下面命令安装

[root@zabbix~]#yum-yinstallzabbix-server-MysqLzabbix-web-MysqLMysqLmariadb-serverhttpdPHP

第三步配置Zabbix数据库

Start the Database (MariaDB) service

[root@zabbix~]#systemctlstartmariadb
[root@zabbix~]#systemctlenablemariadb
ln-s'/usr/lib/systemd/system/mariadb.service''/etc/systemd/system/multi-user.target.wants/mariadb.service'
[root@zabbix~]#

运行MysqL_secure_installation会执行几个设置:

为root用户设置密码 ,删除匿名账号取消root用户远程登录删除test库和对test库的访问权限,刷新授权表使修改生效

[root@zabbix~]#MysqL_secure_installation

创建zabbix数据库"zabbix_db"和zabbix用户“zabbix_user”和授予权限给所有在Zabbix数据库用户

[root@zabbix~]#MysqL-uroot-p
Enterpassword:
WelcometotheMariaDBmonitor.Commandsendwith;or\g.
YourMariaDBconnectionidis10
Serverversion:5.5.47-MariaDBMariaDBServer

Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.

Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

MariaDB[(none)]>createdatabasezabbix_db;
QueryOK,1rowaffected(0.00sec)

MariaDB[(none)]>grantallprivilegesonzabbix_db.*tozabbix_user@localhostidentifiedby<new_password>;
QueryOK,0rowsaffected(0.00sec)

MariaDB[(none)]>flushprivileges;
QueryOK,0rowsaffected(0.00sec)

MariaDB[(none)]>exit
Bye
[root@zabbix~]#

讲zabbix数据库导入到mysq

Now import the database Schema using below commands.

[root@zabbix~]#cd/usr/share/doc/zabbix-server-MysqL-3.0.1
[root@zabbixzabbix-server-MysqL-3.0.1]#gunzipcreate.sql.gz
[root@zabbixzabbix-server-MysqL-3.0.1]#MysqL-uroot-pzabbix_db<create.sql
Enterpassword:
[root@zabbixzabbix-server-MysqL-3.0.1]#

第四步 编辑zabbix Server 配置文件

[root@zabbix~]#vi/etc/zabbix/zabbix_server.conf
...................................
DBHost=localhost主机名称
DBName=zabbix_db数据库名称
DBUser=zabbix_user数据库用户名
DBPassword=XXXXXXX数据库密码X---代表自定义
...................................

保存并退出

配置PHP设置

Set the below parameters in the PHP config file (/etc/PHP.ini )

[root@zabbix~]#vi/etc/PHP.ini
................................
max_execution_time=600
max_input_time=600
memory_limit=256M
post_max_size=32M
upload_max_filesize=16M
date.timezone=Asia/Kolkata
...............................

设置防火墙

[root@zabbix~]#firewall-cmd--permanent--add-port=10050/tcp
success
[root@zabbix~]#firewall-cmd--permanent--add-port=10051/tcp
success
[root@zabbix~]#firewall-cmd--permanent--add-port=80/tcp
success
[root@zabbix~]#firewall-cmd--reload
success
[root@zabbix~]#systemctlrestartfirewalld
[root@zabbix~]#

Set the below Selinux rule.

设置Selinux 规则

[root@zabbix~]#setsebool-Phttpd_can_connect_zabbix=1
[root@zabbix~]#

备注:转上一篇文章关于关闭SELINUX的方法

selinux 是否关闭

查看/etc/selinux/config有以下三个选项选择SELINUX = disabled

SELINUX= can take one of these three values:


enforcing - SELinux security policy is enforced.

permissive - SELinux prints warnings instead of enforcing.

disabled - No SELinux policy is loaded.


启动Zabbix和Web服务器的服务并确保它使整个启动。

[root@zabbix~]#systemctlstartzabbix-server
[root@zabbix~]#systemctlenablezabbix-server
ln-s'/usr/lib/systemd/system/zabbix-server.service''/etc/systemd/system/multi-user.target.wants/zabbix-server.service'
[root@zabbix~]#
[root@zabbix~]#systemctlstarthttpd
[root@zabbix~]#systemctlenablehttpd
ln-s'/usr/lib/systemd/system/httpd.service''/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@zabbix~]#

第五步在浏览器输入http://192.168.12.131/zabbix/

请更换你使用zabbix的服务器IP地址或主机名

Zabbix-Server-Installation


点击Click on ‘Next step’

检查zabbix配置


Zabbix-pre-requisites

点击‘Next step’配置数据库主机名数据库名称端口数据库用户名密码


Zabbix-installation-DB-connection

Click on ‘Next step’ to continue.

Specify the Zabbix Server details and Port number.


Zabbix-Server-Details

Pre-installation summary of Zabbix Servers,click on ‘Next step’ to continue.

Pre-installation-summary-zabbix-server

看到下个画面恭喜你安装成功了

zabbix-installation-successfully

当我们点击 ‘finish’,它将引导我们Zabbix Web界面控制台。

使用用户名为“admin”和密码“Zabbix”

Zabbix-Web-Console

原文链接:https://www.f2er.com/centos/378335.html

猜你在找的CentOS相关文章