需要安装的包:
wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.0.1/zabbix-4.0.1.tar.gz
Zabbix搭建
服务端server:192.168.4.11
客户端agent: 192.168.4.12
步骤一:server端布置LNMP环境:
1.源码安装nginx(先解决依赖关系)
[root@zabbixserver ~]# yum -y install gcc pcre-devel openssl-devel
[root@zabbixserver]# ./configure --prefix=/usr/local/nginx //指定安装的目录
root@zabbixserver ]# make && make install
2.安装mysql和PHP-FPM
[root@zabbixserver ~]# yum -y install php php-mysql
> mariadb mariadb-devel mariadb-server
[root@zabbixserver~]#yum-y install php-fpm-5.4.16-42.el7.x86_64.rpm //解析PHP页面的程序必须装
修改nginx文件可以解析PHP页面
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;
}
:wq
3.把nginx,mysql,php-fpm,启动并检查端口是否开启
root@web1 zabbix-server]# systemctl restart mariadb.service
[root@web1 zabbix-server]# systemctl restart php-fpm.service
[root@web1 zabbix-server]# ln -s /usr/local/nginx/sbin/nginx /sbin/nginx //做个软链接,方便启动nginx(系统命令不是在/bin下就是/sbin下)
[root@web1 zabbix-server]# /usr/local/nginx/sbin/nginx -t //检查配置文件是否正确
[root@web1 zabbix-server]# nginx -s reload //重新启动nginx
[root@web1 zabbix-server]# netstat -tunlp | grep :80 //nginx默认端口
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
[root@web1 zabbix-server]# netstat -tunlp | grep :9000 //php-fpm默认端口
tcp 0 0 0.0.0.