mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
arp: use only awk to process ARP cache
Simplify the processing of the output of arp -an to use only awk. Reduces the needed subprocesses in the pipe.
This commit is contained in:
parent
fec8686c4e
commit
4a56eb1897
2 changed files with 2 additions and 4 deletions
|
@ -38,6 +38,5 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "entries.value "
|
arp -an | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'
|
||||||
arp -an | grep -v "incomplete" | awk '{ print $4; }' | sort -u | wc -l
|
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,5 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "entries.value "
|
arp -an -i $INTERFACE | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'
|
||||||
arp -an -i $INTERFACE | grep -v "incomplete" | awk '{ print $4; }' | sort -u | wc -l
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue