Skip to content

Commit

Permalink
added Nagios check plugin for switch ARP table
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-malets committed Mar 29, 2014
1 parent a1e7a6e commit 8c317c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nagios/check_arp
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

0 comments on commit 8c317c4

Please sign in to comment.