Zabbix监控工具

实验环境准备:

Centos7.0    192.168.200.113 server.zabbix.com
Centos7.0    192.168.200.114 agent.zabbix.com
Windows    192.168.200.2 windows10client

以下实验操作主要注意主机名

server端

配置阿里云yum源

[root@localhost ~]# hostname server.zabbix.com
[root@localhost ~]# bash

[root@server ~]# vim /etc/hostname                                    #编写hostname更改主机名

server.zabbix.com

[root@server ~]# nslookup www.baidu.com                      #测试是否可以上网

[root@server ~]# vim /etc/hosts                                        #修改hosts文件映射

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.200.113 server.zabbix.com 192.168.200.114 agent.zabbix.com 192.168.200.2 windows10 #windows主机

[root@server ~]# scp /etc/hosts 192.168.200.114:/etc                   #通过scp将hosts文件发送给192.168.200.114agent主机

[root@server ~]# cd /etc/yum.repos.d/

[root@server yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo

[root@server yum.repos.d]# ls
a       Centos-7.repo      epel.repo        epel-testing.repo       local.repo
[root@server yum.repos.d]# mv a/CentOS-Base.repo ./
[root@server yum.repos.d]# ls
a    Centos-7.repo     CentOS-Base.repo       epel.repo        epel-testing.repo     local.repo

//部署lamp环境,提供zabbix访问页面,其中PHP部分是为zabbix提供支持

报错如下信息,就是因为安装了mysql-devel

configure:error:MYSQL library not found

[root@server yum.repos.d]# cd
[root@server ~]# yum install -y httpd mariadb-server mariadb mariadb-devel php php-mbstring php-mysql php-bcmath php-gd php-xmlrpc php-ldap php-xml libevent libevent-devel net-snmp net-snmp-devel libxml2-devel libxml2 ntpdate

[root@server ~]# ntpdate sla.time.edu.cn                    #同步时间     清华大学时间服务器

[root@server ~]# systemctl stop firewalld
[root@server ~]# iptables -F
[root@server ~]# setenforce 0
启动LAMP对应服务

[root@server ~]# systemctl start mariadb
[root@server ~]# systemctl enable mariadb

[root@server ~]# systemctl start httpd
[root@server ~]# systemctl enable httpd

[root@server ~]# mysqladmin -u root password 123123

agent端:

[root@localhost ~]# hostname agent.zabbix.com
[root@localhost ~]# bash

[root@agent ~]# vim /etc/hostname

agent.zabbix.com

[root@agent ~]# vim /etc/sysconfig/network

# Created by anaconda
HOSTNAME=agent.zabbix.com

[root@agent ~]# systemctl stop firewalld
[root@agent ~]# iptables -F
[root@agent ~]# setenforce 0

猜你喜欢

转载自www.cnblogs.com/CMX_Shmily/p/11773795.html