Improve BTS monitor script
Just send one line alerts Don't check BTS with no IP address (RBS)
This commit is contained in:
parent
fb78bacc12
commit
04c1091a10
1 changed files with 4 additions and 4 deletions
|
@ -7,6 +7,8 @@ $RHIZO_SCRIPT/monitor_amp.sh
|
||||||
|
|
||||||
for bts in "${BTS[@]}" ; do
|
for bts in "${BTS[@]}" ; do
|
||||||
|
|
||||||
|
if [ "$bts" == "" ] ; then continue ; fi
|
||||||
|
|
||||||
_f="/tmp/bts.error.$bts"
|
_f="/tmp/bts.error.$bts"
|
||||||
|
|
||||||
fping -q -c5 -p90 $bts >/dev/null 2>&1
|
fping -q -c5 -p90 $bts >/dev/null 2>&1
|
||||||
|
@ -24,16 +26,14 @@ for bts in "${BTS[@]}" ; do
|
||||||
else
|
else
|
||||||
# And this is a new condition, so initialise counter and alert
|
# And this is a new condition, so initialise counter and alert
|
||||||
echo 1 > $_f
|
echo 1 > $_f
|
||||||
/usr/local/bin/alert.sh noenc "%F0%9F%98%BF" > /dev/null
|
/usr/local/bin/alert.sh noenc "%F0%9F%98%BF" "$HOSTNAME: BTS $bts no responde a ping." > /dev/null
|
||||||
/usr/local/bin/alert.sh "$HOSTNAME: BTS $bts no responde a ping." > /dev/null
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# BTS is OK
|
# BTS is OK
|
||||||
if [ -f $_f ] ; then
|
if [ -f $_f ] ; then
|
||||||
# This is cancelling a previous error condition, Remove counter and alert.
|
# This is cancelling a previous error condition, Remove counter and alert.
|
||||||
rm $_f
|
rm $_f
|
||||||
/usr/local/bin/alert.sh noenc "%F0%9F%98%B8" > /dev/null
|
/usr/local/bin/alert.sh noenc "%F0%9F%98%BB" "$HOSTNAME: BTS $bts vuelve a responder a ping!" > /dev/null
|
||||||
/usr/local/bin/alert.sh "$HOSTNAME: BTS $bts vuelve a responder a ping!" > /dev/null
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue