1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Plugin-Gallery: Better 2nd level headings

This commit is contained in:
dipohl 2017-02-24 04:09:58 +01:00
parent e10e386b02
commit d216113740
24 changed files with 5 additions and 5 deletions

45
plugins/tcp/tcp-retransmissions Executable file
View file

@ -0,0 +1,45 @@
#!/bin/sh
# tcp_retries revision 2 (Feb 2012)
#
# TCP retransmission rate. Useful for network debugging.
#
# Required privileges: none
#
# OS: Linux with procfs
#
# Author: Artem Sheremet <dot.doom@gmail.com>
#
#%# family=auto
#%# capabilities=autoconf
TCPSTAT=/proc/net/tcp
case $1 in
autoconf)
[ -r $TCPSTAT -o -r ${TCPSTAT}6 ] && echo "yes" || echo "no"
;;
config)
cat <<CONFIG
graph_title TCP retransmissions
graph_vlabel Rate, retrs/sockets
graph_category network
graph_info TCP sockets retransmission counters from $TCPSTAT
rate.label Retransmission rate
rate.draw LINE2
rate.min 0
CONFIG
;;
esac
cat /proc/net/tcp* | awk '
{
TOTAL += $7;
COUNT++;
}
END {
printf "rate.value %.3f\n", TOTAL/COUNT
}
'

54
plugins/tcp/tcp-states Executable file
View file

@ -0,0 +1,54 @@
#!/bin/sh
#
# Plugin to monitor TCP states.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# (C) Marki - count number of connections in each state
# - no LISTEN as we are running netstat without the "-a" option
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if ( netstat -nt 2>/dev/null >/dev/null ); then
echo yes
exit 0
else
if [ $? -eq 127 ]
then
echo "no (netstat program not found)"
exit 1
else
echo no
exit 1
fi
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title TCP Connection States'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel connections'
echo 'graph_category network'
echo 'graph_period second'
echo 'graph_info This graph shows the TCP connections states of all the network interfaces combined.'
for i in ESTABLISHED SYN_SENT SYN_RECV FIN_WAIT1 FIN_WAIT2 TIME_WAIT CLOSE CLOSE_WAIT LAST_ACK CLOSING; do
echo "$i.label $i"
echo "$i.type GAUGE"
echo "$i.max 32999"
echo "$i.min 0"
done
exit 0
fi
netstat -nt | awk '/^tcp/ { states[$6]++ } END { for (idx in states) print idx ".value " states[idx] }'