Zabbix 安装文档
Zabbix 是一种分布式服务监控系统,核心系统由 C语言编写。主要有服务器端 (Server),代理服务器端 (Proxy),被监控端 (Agent) 组成。
-
安装环境:CentOS7.3
-
安装架构:LAMP
-
事前准备
$ setenforce 0 临时关闭 $ sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config $ init 6 重启 $ systemctl stop firewalld $ systemctl disable firewalld
-
Httpd安装
# yum install httpd -y # systemctl start httpd # systemctl enable httpd
-
Mysql安装
# yum install mariadb mariadb-server mariadb-devel -y # systemctl start mariadb # systemctl enable mariadb # mysql_secure_installation #设置密码 # mysql -u root -p #测试登录
-
PHP 安装
yum install -y php php-mysql
为了测试Apache能否正确调用 PHP,在/var/www/html文件下新建phpinfo.php
<?php phpinfo();
查看是否打印出对应信息
-
Zabbix安装
# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm #yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent #授权远程连接 mysql>create database zabbix character set utf8 collate utf8_bin; mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; mysql>quit # cd /usr/share/doc/zabbix-server-mysql-3.2.1 # zcat /usr/share/doc/zabbix-server-mysql-3.2.10/create.sql.gz | mysql -uzabbix -p zabbix
-
修改Zabbix配置文件 # vim /etc/zabbix/zabbix_server.conf
DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
-
启动zabbix服务
systemctl start zabbix systemctl enable zabbix
-
编辑 PHP 前端
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/Shanghai //主要去掉# 改成上海
-
-
登陆Zabbix
默认用户名/密码:Admin/zabbix