34 lines
516 B
Plaintext
34 lines
516 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
export DEBUG=1
|
||
|
export serv=$1
|
||
|
|
||
|
if [ ! -z $serv ]
|
||
|
then
|
||
|
for i in `cat ./hosts/$serv`
|
||
|
do
|
||
|
./checks/$i $serv
|
||
|
done
|
||
|
|
||
|
else
|
||
|
|
||
|
echo -e "\n" >/tmp/report
|
||
|
echo -e "Host\tService\tStatus"
|
||
|
for i in `ls ./hosts/`
|
||
|
do for x in `cat ./hosts/$i`
|
||
|
do
|
||
|
./checks/$x $i > /dev/null
|
||
|
if [ "$?" -ne 0 ]; then
|
||
|
echo -e "$i\t$x\tFAILED"
|
||
|
echo "$i,$x,FAILED" >> /tmp/report
|
||
|
else
|
||
|
echo -e "$i\t$x\tGOOD"
|
||
|
echo "$i,$x,GOOD" >> /tmp/report
|
||
|
fi
|
||
|
done
|
||
|
done
|
||
|
|
||
|
fi | column -t
|
||
|
|
||
|
sed -i '/^\s*$/d' /tmp/report
|