Skip to content

Commit

Permalink
Annotate and fix netstat's active connections match.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad K committed Nov 21, 2016
1 parent 2ae4b1f commit c6efe9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/node.d.linux/netstat
Expand Up @@ -101,8 +101,12 @@ if [ "$1" = "config" ]; then
exit 0
fi

# Newer versions of net tools' netstat have fixed the 'active connection
# openings' string from plural connections to singular. The match hereby is for
# both cases.
#
netstat -s | awk '
/active connection ope/ { print "active.value " $1 }
/active connection(s)? ope/ { print "active.value " $1 }
/passive connection ope/ { print "passive.value " $1 }
/failed connection/ { print "failed.value " $1 }
/connection resets/ { print "resets.value " $1 }
Expand Down

0 comments on commit c6efe9c

Please sign in to comment.