forked from andrey-malets/cfg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Nagios check plugin for switch ARP table
- Loading branch information
1 parent
a1e7a6e
commit 8c317c4
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 2 ]; then | ||
echo 1>&2 "usage: $0 <switch> <mac>" | ||
exit 3 | ||
fi | ||
|
||
switch=$1 | ||
mac=$2 | ||
|
||
base=$(dirname $0) | ||
|
||
count=$(../util/3com.py $switch | grep $mac | wc -l) | ||
|
||
if [ "$count" -eq 0 ]; then | ||
echo 'No mac found in ARP table' | ||
exit 2 | ||
elif [ "$count" -eq 1 ]; then | ||
echo 'ARP record OK' | ||
exit 0 | ||
else | ||
echo "ARP table status unknown ($count records)" | ||
exit 1 | ||
fi |