View port 2222
[[email protected] ~]# lsof -i:2222COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEdocker-pr 7179 root 4u IPv6 378945139 0t0 TCP *:EtherNet/IP-1 (LISTEN)
View the name of the docker running junpserver Process
[[email protected] ~]# ps -ef | grep dockerroot 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
Edit zabbix configuration file
[[email protected] ~]# cd /usr/local/zabbix/etc/[[email protected] etc]# lszabbix_agentd.conf zabbix_agentd.conf.d[[email protected] etc]# vim zabbix_agentd.conf
Find
Userparameter =
Add:
# UserParameter=UserParameter=jumpserver,sh /usr/local/zabbix/etc/process_sh/jumpserver.sh
Jumpserver // process name
SH/usr/local/zabbix/etc/process_sh/jumpserver. Sh // executed script
Then go to the script directory and edit the script.
[[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/bashlsof -i:2222 | grep docker | wc -l
Grant Permissions
[[email protected] process_sh]# chmod 755 jumpserver.sh
Restart zabbix_agentd
[[email protected] process_sh]# /etc/init.d/zabbix_agentd restart
Zabbix jumpserver that monitors docker running