2020-12-29 zabbix 自定义 tcp 11种状态 + simple check 模板-TCP十一种状态-监控TCP- 含TCP内核调优初窥

重点观察:

SYN_RCVD‌:状态是很短的正常是抓不到的,一旦很多就是DDOS一般

服务器收到客户端的SYN请求后,进入SYN_RCVD状态,并向客户端发送SYN+ACK确认。这个

TIME_WAIT‌:NAT出去的LB上一般不要优化TIME_WAIT ! 尤其是GITHUB的!!! 内网的web服务器可以优化!!!也就是说网络条件好的时候可以优化此项,节省资源!

一方发送FIN请求并收到对方的ACK后,进入TIME_WAIT状态,等待足够的时间确保对方收到FIN请求。

TIMEWAT优化:

zabbix   自定义simple check 模板

# zabbix_get 基本使用
zabbix_get -s 127.0.0.1 -p 10050 -k "proc.num[,root,all,nginx]"  #     显示root 下 所有的 java 进程数量 

1、监控端口的几个主要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)

2  自定义监控 tcp 状态的 key

UserParameter=tcp_state[*],netstat -ant|grep -c $1

测试:

zabbix_get -s 127.0.0.1  -k tcp_state[TIME_WAIT]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值