Skip to content

Instantly share code, notes, and snippets.

@FlorianHeigl
Last active February 7, 2022 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianHeigl/7940885367332d272b1139a88e369473 to your computer and use it in GitHub Desktop.
Save FlorianHeigl/7940885367332d272b1139a88e369473 to your computer and use it in GitHub Desktop.
find highest number of incoming and outgoing non-unicast packets
if ! type gawk >/dev/null ; then
echo "script requires gawk, please install it via apt/similar"
fi
cd ~/var/pnp4nagios/perfdata || exit 1
# out
for X in */Interface_*_outnucast.rrd; do
rrdtool fetch $X MAX -r 300 -s -1h | gawk -v x=$X '{printf(x",\t\t %s,%8.2f,%8.2f \n",strftime("%c",$1),$2,$3) }'
done |\
grep -v nan | sort -t',' -r -k3 | head
# in
for X in */Interface_*_innucast.rrd; do
rrdtool fetch $X MAX -r 300 -s -1h | gawk -v x=$X '{printf(x",\t\t %s,%8.2f,%8.2f \n",strftime("%c",$1),$2,$3) }'
done |\
grep -v nan | sort -t',' -r -k3 | head
@FlorianHeigl
Copy link
Author

still need to get the date ranges figured, but maybe this'll help someone else as a startingpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment