监控nginx,jvm
nginx监控TCP和触发器
ZABBIX告警通知
监控mysql
监控WEB
分布式监控
自动化监控,自动发现和自动获取,通过API监控
环境搭建:
搭建nginx
yum install zlib-devel pcre-delvel gcc -openssl-devel tar -zxf nginx-1.14.2.tar.gz cd nginx-1.14.2 useradd -s /sbin/nologin -M nginx ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx-1.14.2 --with-http_stub_status_module --with-http_ssl_module make && make install 创建软连接ln -s /usr/local/nginx-1.14.2/ /usr/local/nginx 启动nginx服务:/usr/local/nginx/sbin/nginx 修改配置文件 [root@localhost conf]# pwd /usr/local/nginx/conf
因为一会要监控nignx的活跃连接数,需要在nginx配置文件中开启远程连接
查看配置文件是否成功:/usr/local/nginx/sbin/nginx -t
ps -ef | grep nginx
kill 26112 # 杀死进程从新启动
从新启动:/usr/local/nginx/sbin/nginx
浏览器访问是否成功
安装zabbix-agentd
配置 yum 源 [root@zabbix-server-1 yum.repos.d]# cat zabbix.repo [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=1
yum clean all # 清除yum缓存
yum makecache # 生成yum缓存
yum install zabbix-agent 修改zabbix-agent配置文件 [root@bogon ~]# vim /etc/zabbix/zabbix_agentd.conf Server=server ip ServerActive=server ip Hostname=Hostname of client system
启动服务
systemctl restart zabbix-agent
添加监控主机
创建主机组
监控nginx活跃连接数
需要在nginx配置文件中开启远程监控