监控端口的几个主要Keys:

net.tcp.listen[port]

Checks if this port is in LISTEN state. 0 - it is not, 1 - it is in LISTEN state.

监控TCP端口是否监听

net.tcp.port[<ip>,port]

Check, if it is possible to make TCP connection to the port number. 0 - cannot connect,

1 - can connect. IP address is optional. If ip is missing, 127.0.0.1 is used.

Example: net.tcp.port[,80]

检查TCP端口是否可以正常连接。

net.tcp.service[service,<ip>,<port>]

Check if service is available. 0 - service is down, 1 - service is running.

If ip is missing 127.0.0.1 is used. If port number is missing, default service port is used.

Example: net.tcp.service[ftp,,45].

检查服务是否可用,FTP服务可直接使用FTP模板

net.tcp.service.perf[service,<ip>,<port>]

Check performance of service "service". 0 - service is down, sec - number of seconds spent on connection to the service.

If ip is missing 127.0.0.1 is used. If port number is missing, default service port is used.

监控服务(端口)连接性能

net.udp.listen[port]

Checks if this port is in LISTEN state. 0 - it is not, 1 - it is in LISTEN state.

监控UDP端口是否监听(不支持windows)

说明:Zabbix自带单独服务检测模板,如Template App FTP Service,就是使用的ket.tcp.service[ftp]这个KEY来监控的。

模板如下,可根据需求修改端口及触发器名称:

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.4</version>
<date>2018-06-19T06:10:48Z</date>
<groups>
<group>
<name>Tcp Port</name>
</group>
</groups>
<templates>
<template>
<template>Template Tcp Port 4234</template>
<name>Template Tcp Port 4234</name>
<description/>
<groups>
<group>
<name>Tcp Port</name>
</group>
</groups>
<applications>
<application>
<name>Tcp Port Monitor</name>
</application>
</applications>
<items>
<item>
<name>tcp port 4234 is listen</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>net.tcp.listen[4234]</key>
<delay>30s</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Tcp Port Monitor</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp port 4234 is connection</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>net.tcp.port[,4234]</key>
<delay>30s</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Tcp Port Monitor</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp port 4234 performance</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>net.tcp.service.perf[http,,4234]</key>
<delay>30s</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Tcp Port Monitor</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp port 4234 is running</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>net.tcp.service[http,,4234]</key>
<delay>30s</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Tcp Port Monitor</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
</items>
<discovery_rules/>
<httptests/>
<macros/>
<templates/>
<screens/>
</template>
</templates>
<triggers>
<trigger>
<expression>{Template Tcp Port 4234:net.tcp.listen[4234].last()}=0</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>tcp port 4234(Paypre) is down</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>5</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger>
</triggers>
<graphs>
<graph>
<name>tcp port 4234</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>1A7C11</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Tcp Port 4234</host>
<key>net.tcp.port[,4234]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<drawtype>0</drawtype>
<color>F63100</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Tcp Port 4234</host>
<key>net.tcp.listen[4234]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<drawtype>0</drawtype>
<color>2774A4</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Tcp Port 4234</host>
<key>net.tcp.service[http,,4234]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<drawtype>0</drawtype>
<color>A54F10</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Tcp Port 4234</host>
<key>net.tcp.service.perf[http,,4234]</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
</zabbix_export>

导入模板

【配置】——【模板】——【导入】

进入模板添加主机

设置被监控主机

查看效果

Zabbix系列之五——监控TCP端口的更多相关文章

  1. zabbix自定义模板——监控TCP连接状态

    TCP十二种连接状态说明 可以使用man netstat查看 LISTEN - 侦听来自远方TCP端口的连接请求: SYN-SENT -在发送连接请求后等待匹配的连接请求: SYN-RECEIVED ...

  2. zabbix自动发现监控远程端口

    zabbix监控远程服务器端口,simple checks是zabbix用来监控无agent的主机 脚本和模板地址: https://github.com/mikeluwen/tcpmonitor

  3. zabbix系列 ~ mongo监控相关

    ,一 简介: 我们来谈谈mongo的监控二 核心命令    rs.status() 关注复制集群是否健康    db.serverStatus() 关注实例整体性能三 目标解读   主要来解读下db. ...

  4. zabbix系列 ~ 自动监控多实例功能

    一 场景     监控mongo的多实例端口二 目标 定制一套模板,根据不同的端口进行批量监控项的生成三 步骤  1 编写py脚本实现端口josin化输出,以便zabbix_server能进行识别  ...

  5. zabbix系列之监控类型及方式

    http://www.ttlsa.com/zabbix/how-to-chose-zabbix-item-type/ zabbix提供十几种监控类型: 监控类型 特性 备注 Zabbix agent ...

  6. zabbix系列之五——安装后配置一

    https://www.zabbix.com/documentation/3.4/manual/appliance Configuration 1Hosts and host groups Overv ...

  7. zabbix系列 ~ linux监控相关

    Linux 监控 一 相关名词解释    cpu context switch (上下文切换)   1 定义 CPU给每个任务一定的服务时间,当时间片轮转的时候,需要把当前状态保存下来,同时加载下一个 ...

  8. zabbix监控tcp连接并发数

    第一步,想在zabbix的web监控tcp连接数,那么要看zabbix-server的版本和zabbix-agent版本是否一致,不然TCP-status图没有数据 也会报错.下图就是版本不符合报错的 ...

  9. zabbix Server 4.0 监控TCP的12种状态

      zabbix Server 4.0 监控TCP的12种状态 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 大家对TCP三次握手比较熟悉了,都知道当发生DOSS攻击时,客户端发送 ...

随机推荐

  1. Linux学习笔记:nginx基础

    nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP pro ...

  2. linux 挂载ntfs格式的硬盘

    一.安装ntfs 1.下载 sudo wget  https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz 2.解压 sudo tar ...

  3. JAVA 8 主要新特性 ----------------(七)新时间日期 API -----LocalDate

    一.改版原因 1.老板的Date和Calander存在问题,日期操作名称混乱,有的在text下,有的在util下,包名混乱         2.Simple包混乱,致命错误线程不安全.        ...

  4. VUE项目 npm run build卡住不动,也不报错

    npm config set registry http://registry.cnpmjs.org try again npm run build 居然能动了....

  5. C++的IO处理中的头文件以及类理解(1)

    C++语言不直接处理输入输出,而是通过一簇定义在标准库中的类型来处理IO.这些类型支持从设备读取数据.向设备写入数据的IO操作,设备可以是文件.控制台窗口等,还有一些类型允许内存IO,即,从strin ...

  6. CSS中清除浮动的作用以及如何清除浮动

    1.什么是浮动,浮动的作用 “浮动”从字面上来理解就是“悬浮移动.非固定”的意思.块级元素(div.table.span…)是以垂直方向排列,而在前端界面中往往要使用水平布局块级元素使界面更美观.这就 ...

  7. dialog记录

    .gyzq{ &.dialog{ background: rgba(83,83,83,0.50); width: 100%; height: 100%; position: fixed; ov ...

  8. LVS简单介绍

    一.LVS简介 linux virtual server简称LVS,Internet的快速增长使多媒体网络服务器面对的访问数量快速增加,服务器需要具备提供大量并发访问服务的能力,因此对于大负载的服务器 ...

  9. shiro与项目集成开发

    shiro与spring web项目开发 加入shiro的jar包 自定义realm /** * 自定义realm 继承授权realm * @author Administrator * */ pub ...

  10. autotrace执行计划中,统计信息详解

    全表扫描是怎么扫描的? oracle最小的存储单位是block 物理上连续的block组成了extent(也就是说一个区中的所有块在物理上是连续的) 很多个extent组成了segment(一个seg ...