Search
j0ke.net Open Build Service
>
Projects
>
internetx
>
nagios-plugins-lsi
> check_mpt2sas
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File check_mpt2sas of Package nagios-plugins-lsi
#!/bin/bash LIST=$(cat /proc/scsi/sg/devices | awk '{ print $NF }') COUNT=1 for i in $LIST; do FAILED=$(cat /proc/scsi/sg/device_strs | head -n$COUNT | tail -n1) if [ $i -eq "-1" ]; then echo CRITICAL - $FAILED exit 2 fi if [ $i -ne "1" ]; then echo WTF - $FAILED exit 3 fi let COUNT=COUNT+1 done echo OK - $(cat /proc/scsi/sg/device_strs | sed 's/$/ -/' | paste $(perl -e "print \"- \"x$COUNT;"))