Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / network / tcp-retransmissions @ dd4afac8

Historique | Voir | Annoter | Télécharger (563 octets)

1 fda46878 Artem
#!/bin/bash
2
3
case $1 in
4
    config)
5
        cat <<EOF
6
graph_title TCP retransmissions
7
graph_vlabel Rate, retrs/sockets
8
graph_category network
9
graph_info dynamic TCP socket retransmission counters
10
rate.label Retransmission rate
11
rate.draw LINE2
12
EOF
13
14
	exit 0
15
        ;;
16
    autoconf)
17
        if [ -f /proc/net/tcp -o -f /proc/net/tcp6 ]
18
        then
19
            echo yes
20
            exit 0
21
        else
22
            echo no
23
            exit 1
24
        fi
25
esac
26
27
cat /proc/net/tcp* | awk '
28
{
29
	TOTAL += $7;
30
	COUNT++;
31
}
32
33
END {
34
	printf "rate.value %.3f\n", TOTAL/COUNT
35
}
36
'