Centos7下安装部署Zabbix-server 3.4

1. Zabbix简介

  • zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
  • zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。
  • zabbix由2部分构成,zabbix server与可选组件zabbix agent。
  • zabbix server可以通过SNMP,zabbix-agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,FreeBSD,Open BSD,OS X等平台上。

2. 服务器准备

2.1 主机信息+IP地址
#一台虚拟机
hostname:Zabbix-server
ip:server_ip_address
2.2 查看主机的系统版本信息
[yuki@Zabbix-server tools]$ cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
2.3 暂时关掉防火墙和Selinux
[yuki@Zabbix-server tools]$ sudo firewall-cmd --state
running
[yuki@Zabbix-server tools]$ cat /etc/sysconfig/selinux 

# This file controls the state of SELinux on the system.
# 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.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
---------------------------------------------------------------------------------------------------------------------------------------
[yuki@Zabbix-server tools]$ sudo systemctl stop firewalld.service
[yuki@Zabbix-server tools]$ sudo firewall-cmd --state                 
not running

[yuki@Zabbix-server tools]$ sudo setenforce 0  &&   sudo getenforce
[yuki@Zabbix-server tools]$ sudo sed -i  "s/SELINUX=enforcing/SELINUX=disabled/g"  /etc/sysconfig/selinux 

3. 安装Zabbix-server需要的环境(LAMP: httpd服务+数据库服务+php)

3.1 LAMP介绍
  • LAMP:Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。
  • LNMP:LNMP指的是一个基于CentOS/Debian编写的Nginx、PHP、MySQL、phpMyAdmin、eAccelerator一键安装包。可以在VPS、独立主机上轻松的安装LNMP生产环境。
3.2 安装apache也就是httpd服务
3.2.1 直接yum安装
[yuki@Zabbix-server tools]$ sudo yum install -y httpd
[yuki@Zabbix-server tools]$ sudo  rpm -qa|grep httpd
httpd-2.4.6-89.el7.centos.x86_64
httpd-tools-2.4.6-89.el7.centos.x86_64
3.2.2 设置httpd服务开机自启动
[yuki@Zabbix-server tools]$ sudo systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[yuki@Zabbix-server tools]$ echo $?
0
3.2.3 启动httpd服务
[yuki@Zabbix-server tools]$ sudo systemctl start httpd && sudo echo $?
0

### 查看是否启动成功
[yuki@Zabbix-server tools]$ sudo systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 二 2019-05-07 11:20:50 CST; 2min 24s ago   ###active (running)###
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 18729 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─18729 /usr/sbin/httpd -DFOREGROUND
           ├─18730 /usr/sbin/httpd -DFOREGROUND
           ├─18731 /usr/sbin/httpd -DFOREGROUND
           ├─18732 /usr/sbin/httpd -DFOREGROUND
           ├─18733 /usr/sbin/httpd -DFOREGROUND
           └─18734 /usr/sbin/httpd -DFOREGROUND

5月 07 11:20:50 Zabbix-server systemd[1]: Starting The Apache HTTP Server...
5月 07 11:20:50 Zabbix-server httpd[18729]: AH00557: httpd: apr_sockaddr_info_get() failed for Zabbix-server
5月 07 11:20:50 Zabbix-server httpd[18729]: AH00558: httpd: Could not reliably determine the server's fully qualified ...essage
5月 07 11:20:50 Zabbix-server systemd[1]: Started The Apache HTTP Se
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值