Skip to content

Commit

Permalink
check IPMI hosts by looking at the ARP table of corresponding switch
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-malets committed Mar 29, 2014
1 parent 8c317c4 commit e5f6eae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cfg/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ hosts:
- [[it-mplan,it-m], 9.15, 002b789fa22f]
- [[postel-mplan,p-m], 9.16, 00065bff8f1b]
- [ ap0, 9.17, 001225556be2]
- [[markov-ipmi, m-i], 9.18, 0015176b9b3e]
- [[hamming-ipmi, h-i], 9.19, 000423d68970]
- [[markov-ipmi, m-i], 9.18, 0015176b9b3e, {switch: hs}]
- [[hamming-ipmi, h-i], 9.19, 000423d68970, {switch: hs}]
- [ ap1, '9.20', '001225557506']
- [[tesla, t], 9.21, 001e670fafcc, {admin: uzer}]
- [[tesla-ipmi, t-i], 9.22, 001e670fafce]
- [[tesla-ipmi, t-i], 9.22, 001e670fafce, {switch: hs}]
- [[633-ups, bfu], 9.23, 00c0b731da0e]
- [[airlab-switch, as], 9.24, 001b11c34547]
- [[ritchie-ipmi, r-i], 9.25, 001e670fac42]
- [[ritchie-ipmi, r-i], 9.25, 001e670fac42, {switch: hs}]
- [[ritchie, r], 9.26, [001e670fac40, 001e670fac41], {admin: uzer}]
- [ hp-high-ups, 9.27, 00c0b798608d]
- [ hp-low-ups, 9.28, 00c0b72f2677]
Expand Down
4 changes: 2 additions & 2 deletions cfg/nagios.template
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ define host {
{%- endif %}
contacts {% if 'admin' in host.props %}{{ host.props['admin'] }},{% endif %}default

{% if 'ipmi' in host.services and host.macs|count == 1 %}
check_command check_arp_table!{{ host.addr }}!{{ host.macs[0] }}
{% if 'ipmi' in host.services and host.macs|count == 1 and 'switch' in host.props %}
check_command check_arp_table!{{ host.props['switch'] }}!{{ host.macs[0] }}
{% endif %}
}

Expand Down
6 changes: 3 additions & 3 deletions nagios/check_arp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ if [ $# -ne 2 ]; then
fi

switch=$1
mac=$2
mac=${2//:/}

base=$(dirname $0)
base=$(dirname $(readlink -f $0))

count=$(../util/3com.py $switch | grep $mac | wc -l)
count=$($base/../util/3com.py $switch | grep $mac | wc -l)

if [ "$count" -eq 0 ]; then
echo 'No mac found in ARP table'
Expand Down

0 comments on commit e5f6eae

Please sign in to comment.