Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
nagios-plugins-ipmi
> check_ipmi_chassis
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File check_ipmi_chassis of Package nagios-plugins-ipmi
#!/bin/bash STATEF=/var/cache/nagios/check_ipmi_chassis STATED=$(dirname $STATEF) NGPH=$(dirname $0) test -d $STATED || mkdir $STATED test -f $STATEF || { echo 'Problem: No file with known good ipmi chassis state is present. Please run: ipmitool chassis status >'$STATEF >&2 exit 3 } ipmitool chassis status >$STATEF.new || { echo 'Problem: ipmitool command failed' >&2 exit 3 } MSG="$( diff -wBiy $STATEF $STATEF.new | while read s; do case $s in (*\|*) COMP=$(echo $s | cut -d: -f1) STATE=$(echo $s | cut -d: -f3) echo -n $COMP is now $STATE' ' ;; esac done )" case $MSG in '') echo Chassis unchanged exit 0;; *) echo "$MSG" exit 2;; esac