zabbix基本概述
zabbix是基于web界面的分布式系统监控与网络设备监控系统,能监控各种网络参数,并提供灵活的通知机制,以便管理员快速定位故障并解决
zabbix agent(客户端):安装在需要被监控的服务器上,主要完成对硬件信息或与操作系统有关的内存、CPU等信息的收集
环境说明
软件 | 版本 | 备注 |
zabbix | 6.0.13 | |
mysql | 8.0.27 | mysql作为zabbix后端数据库,需要I浓浓DBengin |
NGINX | 1.20.0 | |
PHP | 7.4.7 | zabbix6.0 需要PHP版本7.25以上8.0以下 |
zabbix6.0 对相关软件版本要求较高,需要php7.25以上php8.0以下版本支持,若使用mysql数据库,其最低要求为mysql8.0
NGINX安装略
配置nginx.conf支持php解析
vim /mnt/nginx/conf/nginx.conf
#配置如下
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
location / {
index index.php index.html index.htm;
}
location ~ \.php$ {
#root /mnt/nginx/html/zabbix/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
PHP安装
1.安装依赖包
yum -y install libxml2-devel sqlite-devel bzip2 bzip2-devel libcurl libcurl-devel
安装oniguruma:
一个正则表达式的库,在编译安装php时,使用--with-mbstring扩展模块需要oniguruma的支持
yum install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.6-1.el7.remi.x86_64.rpm
yum install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.6-1.el7.remi.x86_64.rpm
或源码:
wgethttps://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5-rev1.tar.gz -O onig-6.9.5.tar.gz
tar xf onig-6.9.5.tar.gz
cd onig-6.9.5
./configure --prefix=/mnt/oniguruma --libdir=/lib64 make && make install
2.下载安装PHP
编译参数可查看:PHP: 其他变更 - Manual
wget https://www.php.net/distributions/php-7.4.7.tar.gz
tar xf php-7.4.7.tar.gz
cd php-7.4.7/
./configure --prefix=/mnt/php \
--with-config-file-path=/mnt/php/etc \
--with-bz2 \
--with-curl \
--enable-ftp \
--enable-sockets \
--disable-ipv6 \
--enable-gd \
-with-jpeg \
--enable-fpm \
--enable-mbstring \
--with-openssl \
--enable-bcmath \
-with-gettext \
--with-ldap-sasl \
--with-mysqli \
--with-pdo-mysql \
--enable-bcmath \
--with-freetype \
--with-ldap=shared \
--enable-calendar \
--enable-dom \
--enable-xml \
--with-libdir=lib64
执行安装
make && make install
安装成功
Installing shared extensions: /mnt/php/lib/php/extensions/no-debug-non-zts-20190902/
Installing PHP CLI binary: /mnt/php/bin/
Installing PHP CLI man page: /mnt/php/php/man/man1/
Installing PHP FPM binary: /mnt/php/sbin/
Installing PHP FPM defconfig: skipp