zabbix-Custom monitoring items (monitoring site 80 connections)

Source: Internet
Author: User

Custom monitoring Items (monitor site 80 connections)

Requirements: Monitoring a web of 80 port connections, and out of the picture;

The first step: client creation Script:

The client-side definition script, and edit the zabbix-agent configuration file implementation run the definition of the script;

Client settings
vim /usr/local/sbin/estab.sh            //创建脚本
#!/bin/bash##获取80端口并发连接数netstat -ant |grep ‘:80‘ |grep -c ESTABLISHED##netstat -ant是查看当前连接数,grep ‘:80‘是过滤出80端口,grep -c ESTABLISHED是统计ESTABLISHED有多少列
chmod 755 /usr/local/sbin/estab.sh            //给脚本755权限,拥有者可读写执行,其他可读和执行;
vim /etc/zabbix/zabbix_agentd.conf            //编辑配置文件,增加下面代码
UnsafeUserParameters=1        //表示使用自定义脚本UserParameter=my.estab.count[*],/usr/local/sbin/estab.sh                //自定义键值名my.estab.count,后面的[*]里面写脚本的参数,如果没有参数则可以省略,脚本为/usr/local/sbin/estab.sh
systemctl restart zabbix-agent            //重启zabbix-agent服务
Step two: Server-side test script:

Service-side verification, the execution of the command is normal;

zabbix_get -s 192.168.188.3 -p 10050 -k ‘my.estab.count‘            //使用zabbix_get工具 连接到192.168.188.3:10050 执行键值my.estab.count
Step three: Web Setup Step 1: Create a monitoring entry

Configuration--Host--Select the corresponding host ' shu001 '--select ' Monitor '--' Create monitoring item '

Step 2: Add graphics to the monitoring item

Configuration--host--' shu001 ' host--graphics--Create graphics--give the graph a cool name--Add a monitoring item to the graph "Monitor 80 concurrency" (that is, the monitor item you just created)--add

zabbix-Custom monitoring items (monitoring site 80 connections)

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.