前言如果你用阿里云或者腾讯云,他们有各种监控可以帮到我们。但是如果遇到维护自己机房的服务器,那么一些可视化或者监控就非常有意义了。监控的解决方案可能有很多种。这里使用比较老的一体机zabbix来解决服务监控问题。由于zabbix是WEB可视化,所以需要WEB服务。(LNMP或LAMP)zabbix原理简述...待补充zabbix环境准备(LNMP或LAMP)PHP编译参数参考(php7.2版本)./configure--prefix=/opt/php72--with-config-文件扫描目录=/opt/php72/etc/php.d--disable-debug--with-pic--with-bz2--with-gettext--with-gmp--enable-mbregex--enable-mbstring--with-openssl--with-zlib--with-layout=GNU--enable-exif--enable-zip--enable-sockets--enable-xml--with-pear--enable-fpm--with-pdo-mysql--with-curl--with-gd--with-mysqli--enable-soap--with-fpm-user=apache--with-fpm-group=apache--with-freetype-dir--enable-mbstring--enable-bcmath--with-jpeg-dir--with-ldap-dirphp.ini需要配置参考max_execution_time=300默认配置30smemory_limit=128M默认128Mpost_max_size=16Mupload_max_filesize=2Mmax_input_time=300date.timezone=PRC安装ldap参考yuminstallopenldapopenldap-devel-ycp-frp/usr/lib64/libldap*/usr/lib/安装步骤1.资源下载https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.11/zabbix-3.4.11.tar.gz2.编译安装yum-yinstallmysql-develmysql客户端依赖于`--with-mysql`yuminstallnet-snmp-develsnmp依赖于`--with-net-snmp`yuminstalllibevent-devellibevent依赖于`--with-libcurl`。/configure--prefix=/opt/zabbix/--enable-server\--enable-agent--with-mysql=/usr/bin/mysql_config--with-net-snmp--with-libcurl--with-libxml2groupaddzabbixuseradd-gzabbixzabbix3.导入zabbix数据createdatabasezabbixdefaultcharsetutf8;zabbix-3.4.11/database/mysql首先导入表结构schema.sql导入表数据data.sqlimages.sql4.启动服务端服务(datacollector),启动客户端服务(datacollector)配置,启动servervim...zabbix_server.conf(configurationlocatedin/opt/zabbix/etc)configuration:DBName=zabbixDBUser=你的数据库连接用户名DBPassword=数据库密码DBPort=3306hint(如果数据库和zabbix不在同一个平台,记得授权连接权限)启动:zabbix安装目录····/sbin/zabbix_server配置,启动agentedvimzabbix_agentd.conf(配置位于/opt/zabbix/etc)配置:Server=127.0.0.1ServerActive=127.0.0.1Hostname=Zabbixserverstartup:zabbix安装目录····/sbin/zabbix_agentd5.配置前端页面复制源码,位于解压后的frontends/php/*cp-rpfrontends/php/*/var/www/html/zabbixnginx配置server部分,(PHP自行百度安装)开始nginx6.zabbix在线安装。如果进入这个页面,就证明前面的步骤都成功了。接下来只需要处理PHP依赖、配置、数据库配置即可。7.登录默认账号密码adminzabbix
