Zabbix jumpserver that monitors docker running

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.