Zabbix 监控docker运行的jumpserver

Posted 987432com

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix 监控docker运行的jumpserver相关的知识,希望对你有一定的参考价值。

查看2222端口

[[email protected] ~]# lsof -i:2222
COMMAND    PID USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
docker-pr 7179 root    4u  IPv6 378945139      0t0  TCP *:EtherNet/IP-1 (LISTEN)

查看docker运行junpserver进程名称

[[email protected] ~]# ps -ef | grep docker
root      7179 26590  0 08:04 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 2222 -container-ip 172.17.0.2 -container-port 2222

编辑zabbix配置文件

[[email protected] ~]# cd /usr/local/zabbix/etc/
[[email protected] etc]# ls
zabbix_agentd.conf  zabbix_agentd.conf.d
[[email protected] etc]# vim zabbix_agentd.conf

找到

UserParameter=

添加:

# UserParameter=
UserParameter=jumpserver,sh /usr/local/zabbix/etc/process_sh/jumpserver.sh

jumpserver//进程名称
sh /usr/local/zabbix/etc/process_sh/jumpserver.sh//执行的脚本

然后进入脚本目录编辑脚本

[[email protected] etc]# mkdir /usr/local/zabbix/etc/process_sh/
[[email protected] etc]# cd /usr/local/zabbix/etc/process_sh/
[[email protected] process_sh]# vim jumpserver.sh
#/bin/bash
lsof -i:2222 | grep docker | wc -l

赋予权限

[[email protected] process_sh]# chmod 755 jumpserver.sh

重启zabbix_agentd

[[email protected] process_sh]# /etc/init.d/zabbix_agentd  restart

技术分享图片

技术分享图片


以上是关于Zabbix 监控docker运行的jumpserver的主要内容,如果未能解决你的问题,请参考以下文章

Zabbix自定义key监控docker

使用 Docker 安装 Zabbix,并配置自定义监控项

使用 Docker 安装 Zabbix,并配置自定义监控项

自动化监控利器 Zabbix 安装详细过程(含 Docker for Zabbix)

Zabbix在Docker中的应用和监控

Zabbix实战之运维篇Zabbix监控Docker容器配置方法