-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathudp
executable file
·37 lines (34 loc) · 823 Bytes
/
udp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
if [ "$1" = "autoconf" ]; then
echo 'yes'
exit 0
fi
if [ "$1" = "config" ]; then
cat <<EOF
graph_title UDP Datagrams
graph_category network
graph_vlabel datagrams in (-) / out (+) per \${graph_period}
graph_args --base 1000
graph_info per zone udp datagrams
inDatagrams.label in
inDatagrams.type DERIVE
inDatagrams.min 0
inDatagrams.graph no
outDatagrams.label udp
outDatagrams.type DERIVE
outDatagrams.min 0
outDatagrams.negative inDatagrams
inErrors.label inerrors
inErrors.type DERIVE
inErrors.min 0
inErrors.graph no
inErrors.warning 1
outErrors.label errors
outErrors.type DERIVE
outErrors.min 0
outErrors.negative inErrors
outErrors.warning 1
EOF
exit 0
fi
kstat -p udp:*:udp:inDatagrams udp:*:udp:outDatagrams udp:*:udp:inErrors udp:*:udp:outErrors | sed 's/.*://' | awk '{ print $1 ".value", $2 }'