前言:
Zabbix:是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
LAMP:
- CentOS7
- Server version: Apache/2.4.6 (CentOS),
- Server version: 5.7.19 MySQL Community Server (GPL)
- PHP 7.0.22 (cli) (built: Aug 9 2017 18:23:24) ( NTS )
临时
关闭selinux
1.[root@centos-1]# setenforce 0
将selinux的参数改为“
disabled
”,这可以永久关闭selinux
1.[root@centos-1]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
or
1.vi /etc/selinux/config
1.[root@centos-1]# yum install epel-release.noarch wget vim gcc gcc-c++ lsof chrony tree nmap unzip rsync -y
2.[root@centos-1]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
1.[root@centos-1 html]# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
2.[root@centos-1 html]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
3.[root@centos-1 html]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-get
1.[root@centos-1 html]# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
2.[root@centos-1 html]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
3.[root@centos-1 html]# yum install zabbix-agent
1.mysql> CREATE DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; <---创建数据库并制定默认编码为utf8,防止乱码
2.Query OK, 1 row affected (0.00 sec)
3.
4.mysql> GRANT ALL ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY '775120@Zabbix'; <----为zabbix创建账号并授权
5.Query OK, 0 rows affected, 1 warning (0.01 sec)
6.
7.mysql> flush privileges; <-----刷新
8.Query OK, 0 rows affected (0.01 sec)
1.[root@centos-1 lcr]# vim /etc/zabbix/zabbix_server.conf
将下面几个参数修改为上一小节创建的数据及账号
- DBHost=
localhost
##默认即可,除非数据库不在server机上- DBName=
zabbix
##数据库(database)名称- DBUser=
zabbix
##用户名user- DBPassword=
775120@Lai
##密码password
1.[root@centos-1 lcr]# vim /etc/httpd/conf.d/zabbix.conf
如下修改,注意删除
注释符#
php_value date.timezoneAsia/Chongqing
1.[root@centos-1 lcr]# vim /etc/zabbix/zabbix_server.conf
修改如下几项参数
- Server=
zabbix server ip
<—server机的IP- ServerActive=
zabbix server ip
- Hostname=
本机Ip
#不要用127.0.0.1- ListenPort=
10050
1.[root@centos-1 ~]# systemctl restart httpd
2.[root@centos-1 ~]# systemctl start zabbix-server
1.[root@centos-1 ~]# systemctl start zabbix-agent
server机上访问:
http://server-ip/zabbix
可见的名称:
页面显示的名称
群租:将主机归入某个群组
填写IP地址,端口,默认为10050
输入“
Linux
”即可选择该模板,如果不是linux主机,酌情选择别的模板
至此,安装完成点击回到我的主页