Zabbix系列之五——监控TCP端口
监控端口的几个主要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端口的更多相关文章
- zabbix自定义模板——监控TCP连接状态
TCP十二种连接状态说明 可以使用man netstat查看 LISTEN - 侦听来自远方TCP端口的连接请求: SYN-SENT -在发送连接请求后等待匹配的连接请求: SYN-RECEIVED ...
- zabbix自动发现监控远程端口
zabbix监控远程服务器端口,simple checks是zabbix用来监控无agent的主机 脚本和模板地址: https://github.com/mikeluwen/tcpmonitor
- zabbix系列 ~ mongo监控相关
,一 简介: 我们来谈谈mongo的监控二 核心命令 rs.status() 关注复制集群是否健康 db.serverStatus() 关注实例整体性能三 目标解读 主要来解读下db. ...
- zabbix系列 ~ 自动监控多实例功能
一 场景 监控mongo的多实例端口二 目标 定制一套模板,根据不同的端口进行批量监控项的生成三 步骤 1 编写py脚本实现端口josin化输出,以便zabbix_server能进行识别 ...
- zabbix系列之监控类型及方式
http://www.ttlsa.com/zabbix/how-to-chose-zabbix-item-type/ zabbix提供十几种监控类型: 监控类型 特性 备注 Zabbix agent ...
- zabbix系列之五——安装后配置一
https://www.zabbix.com/documentation/3.4/manual/appliance Configuration 1Hosts and host groups Overv ...
- zabbix系列 ~ linux监控相关
Linux 监控 一 相关名词解释 cpu context switch (上下文切换) 1 定义 CPU给每个任务一定的服务时间,当时间片轮转的时候,需要把当前状态保存下来,同时加载下一个 ...
- zabbix监控tcp连接并发数
第一步,想在zabbix的web监控tcp连接数,那么要看zabbix-server的版本和zabbix-agent版本是否一致,不然TCP-status图没有数据 也会报错.下图就是版本不符合报错的 ...
- zabbix Server 4.0 监控TCP的12种状态
zabbix Server 4.0 监控TCP的12种状态 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 大家对TCP三次握手比较熟悉了,都知道当发生DOSS攻击时,客户端发送 ...
随机推荐
- js电子表
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 前端(主要html/css)学习笔记
一个浪漫的网站: http://www.romancortes.com/blog/1k-rose/
- explicit_defaults_for_timestamp引发的狗血剧情
今天就碰到了一个较初级的问题,居然为找这个参数花了好半天时间,深以为不齿.需求是这样的,有个表的某个字段需要从datetime改成timestamp类型.原结构如下:create table tmp1 ...
- Paper | 量化CV任务的关联性,寻找最佳迁移策略(Taskonomy)
目录 1. 问题 2. 方法 3. 实验设计 3.1. 解决词典内部(一组已知)任务的能力 3.2. 解决新任务(少量标记数据)的能力 4. 讨论和启发 论文:Taskonomy: Disentang ...
- 11-jQuery的事件绑定和解绑
1.绑定事件 语法: bind(type,data,fn) 描述:为每一个匹配元素的特定事件(像click)绑定一个事件处理器函数. 参数解释: type (String) : 事件类型 data ( ...
- python set所用后列表不改变里面内容排序
my_list = [1,2,1,54,5,64,4681,4,676] my_list_two = list(set(my_list)) my_list_two.sort(key = my_list ...
- CSS伪类的理解
因为之前一直对css伪类没有过多的了解,在网上看到一段css代码,不能理解 a:hover span.title{ color:red; ......... } 现通过查询css手册,其实css伪类只 ...
- 最近一个dish项目的建设思考
系统通用能力的沉淀:a.核心模型的数据沉淀 b.通用服务能力的沉淀 ps1:以前重心主要放在了业务的抽象和通过设计模式来增加可复用的扩展性.局限在于,抽象的范围会被单个业务或者当前的业务所束缚,在更大 ...
- wxPyhon 的控件(摘抄)
一.静态文本控件 wx.StaticText(parent, id, label, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, n ...
- pycharm断点应用
1.在需要打断点行处,单击鼠标左键打断点 2.调试程序开始,在第一个断点之前停止 3.跳过第一个断点进入到下一个断点