Projet

Général

Profil

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

root / plugins / network / arp @ 626f42fa

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

1
#!/bin/sh
2
#
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

    
13
#%# family=contrib
14
#%# capabilities=autoconf
15

    
16
if [ "$1" = "autoconf" ]; then
17
    # Search for arp
18
    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
	echo 'graph_scale no'
33
        echo 'graph_info This graph shows the number of ARP entries registered by the system.'
34
	echo 'entries.label ARP entries'
35
	echo 'entries.draw LINE2'
36
	echo 'entries.type GAUGE'
37
	echo 'entries.info Number of ARP entries'
38
	exit 0
39
fi
40

    
41
arp -an | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'