Projet

Général

Profil

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

root / plugins / network / arp @ c3660c2a

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

1 04415c4b Bj?rn Ruberg
#!/bin/sh
2 626f42fa Kenyon Ralph
#
3
# Plugin to monitor total ARP entries
4
#
5
#  Parameters understood:
6
#
7
#      config   (required)
8
#      autoconf (optional)
9
#
10
#  Made by Sven Hartge (sven AT svenhartge DOT de)
11
#
12 04415c4b Bj?rn Ruberg
13
#%# family=contrib
14
#%# capabilities=autoconf
15
16
if [ "$1" = "autoconf" ]; then
17 626f42fa Kenyon Ralph
    # Search for arp
18 04415c4b Bj?rn Ruberg
    which arp >/dev/null 2>/dev/null || (echo "no (can't find arp binary)" && exit 1)
19
20
    # ...or success
21
    echo yes
22
    exit 0
23
fi
24
25
26
27
if [ "$1" = "config" ]; then
28
        echo 'graph_title ARP entries'
29
        echo 'graph_args --base 1000 -l 0'
30
        echo 'graph_vlabel Entries'
31
        echo 'graph_category network'
32 626f42fa Kenyon Ralph
	echo 'graph_scale no'
33 04415c4b Bj?rn Ruberg
        echo 'graph_info This graph shows the number of ARP entries registered by the system.'
34
	echo 'entries.label ARP entries'
35 626f42fa Kenyon Ralph
	echo 'entries.draw LINE2'
36 04415c4b Bj?rn Ruberg
	echo 'entries.type GAUGE'
37
	echo 'entries.info Number of ARP entries'
38
	exit 0
39
fi
40
41 626f42fa Kenyon Ralph
arp -an | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'