1,安装zabbix-server包
yum install -y /share/zabbix3.2/zabbix-server-mysql-3.2.1-1.el7.x86_64.rpm /share/zabbix3.2/zabbix-get-3.2.1-1.el7.x86_64.rpm mariadb-server
yum install -y httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml
yum install -y /share/zabbix3.2/zabbix-web-3.2.1-1.el7.noarch.rpm /share/zabbix3.2/zabbix-web-mysql-3.2.1-1.el7.noarch.rpm
2,修改php.ini时区
vim /etc/php.ini
3,数据库操作
vim /etc/my.cnf
skip_name_resolve=ON
innodb_file_per_table=ON
create database zabbix;
grant all on zabbix.* to 'zbxuser'@'192.168.153.128' identified by 'zbxpass';
flush privileges;
gzip -d /usr/share/doc/zabbix-server-mysql-3.2.1/create.sql.gz
mysql zabbix < /usr/share/doc/zabbix-server-mysql-3.2.1/create.sql
4,修改zabbix配置文件
vim /etc/zabbix/zabbix_server.conf
5,通过浏览器访问安装zabbix
6,安装客户端
yum install /share/zabbix3.2/zabbix-agent-3.2.1-1.el7.x86_64.rpm /share/zabbix3.2/zabbix-sender-3.2.1-1.el7.x86_64.rpm -y
修改配置文件
vim /etc/zabbix/zabbix_agentd.conf
UserParameter=nginx.info.usage[*],curl -s http://192.168.153.129/fpmstatus | tr -s ' ' |awk -F': ' '/^$1/{print $$2}'
启动服务
systemctl restart zabbix-agent.service
安装 php-fpm
yum install php-fpm /share/nginx-1.10.2-1.el7.ngx.x86_64.rpm -y
编辑配置文件
vim /etc/nginx/conf.d/default.conf
location ~* ^/(fpmstatus|ping)/? {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
include fastcgi_params;
}
编辑配置文件
vim /etc/php-fpm.d/www.conf
启动服务
7,添加主机到监控服务器上
添加监控fpm的item
继续添加其他信息
继续添加
最终如下