5.02021-11-21T21:26:47ZTemplatesSockstat Statistics WindowsTCP/UDP Stats Windows## Overview
Starting from the template that they published in:
<https://systembash.com/track-tcp-and-udp-connections-with-zabbix/>
I have modified the parameters for use in Windows. For it to work, add the following lines in UserParameter of zabbix\_agent.conf
UserParameter=sockstat.sockets, netstat -ano | find /V "hola" /C
UserParameter=sockstat.tcp.inuse, netstat -ano | findstr ESTABLISHED
UserParameter=sockstat.tcp.inuse.count, netstat -ano | find /C "ESTABLISHED"
UserParameter=sockstat.tcp.orphan, netstat -ano | findstr CLOSE\_WAIT
UserParameter=sockstat.tcp.orphan.count, netstat -ano | find /C "CLOSE\_WAIT"
UserParameter=sockstat.tcp.timewait, netstat -ano | findstr TIME\_WAIT
UserParameter=sockstat.tcp.timewait.count, netstat -ano | find /C "TIME\_WAIT"
UserParameter=sockstat.tcp.allocated, netstat -ano | findstr LISTENING
UserParameter=sockstat.tcp.allocated.count, netstat -ano | find /C "LISTENING"
UserParameter=sockstat.udp.inuse, netstat -ano | findstr UDP
UserParameter=sockstat.udp.inuse.count, netstat -ano | find /C "UDP"
Restart Zabbix agent
## Author
Sancho
TemplatesNetwork Sockets- Total Socketssockstat.sockets603d7dsocketsNumber of open socketsNetwork Sockets
- TCP Sockets in LISTENINGsockstat.tcp.allocated601d0LOGNetwork Sockets
- TCP Sockets in LISTENING Countsockstat.tcp.allocated.count603d7dsocketsNetwork Sockets
- TCP Sockets In ESTABLISHEDsockstat.tcp.inuse601d0LOGTCP sockets currently in use on the system.Network Sockets
- TCP Sockets in ESTABLISHED Countsockstat.tcp.inuse.count603d7dsocketsNetwork Sockets
- TCP Sockets in CLOSE_WAITsockstat.tcp.orphan601d0LOGNetwork Sockets
- TCP Sockets in CLOSE_WAIT Countsockstat.tcp.orphan.count603d7dsocketsNetwork Sockets
- TCP Sockets in TIME_WAITsockstat.tcp.timewait601d0LOGNetwork Sockets
- TCP Sockets in TIME_WAIT Countsockstat.tcp.timewait.count603d7dsocketsNetwork Sockets
- UDP Sockets In Usesockstat.udp.inuse601d0LOGNetwork Sockets
- UDP Sockets In Use Countsockstat.udp.inuse.count603d7dsocketsNetwork Sockets
TCP StatusFIXEDDDDD00- Sockstat Statistics Windowssockstat.tcp.orphan.count
100CC00- Sockstat Statistics Windowssockstat.udp.inuse.count
22774A4- Sockstat Statistics Windowssockstat.tcp.inuse.count
3A54F10- Sockstat Statistics Windowssockstat.tcp.allocated.count
4EE0000- Sockstat Statistics Windowssockstat.tcp.timewait.count
5777777- Sockstat Statistics Windowssockstat.sockets