hello,
This is an unusual request, I have seven servers running with Asterisk, no in the same place, I need to set up an alarm that sends me an email telling me that the command asterisk -rx “dahdi show status” y giving back a RED alarm.
this is the script I’ve made to do that:
ALERT=$(asterisk -rx “dahdi show status” | grep RED)
echo .$ALERT.
if [ “$ALERT” ]; then
echo .E1 is down. |mail -s E1 is down MYEMAIL@MYdomain.com
fi
ALERT=$(asterisk -rx “dahdi show status” |grep YELLOW)
echo .$ALERT.
if [ “$ALERT” ]; then
echo .Yellow alarm. |mail -s Warning MYEMAIL@MYdomain.com
fi
ALERT=$(asterisk -rx “dahdi show status” |grep ALARM |grep OK)
echo .$ALERT.
if [ “$ALERT”]; then
echo .E1 is OK . |mail -s it’s fine MYEMAIL@MYdomain.com
fi
but it doesen’t work,
can you help me?
excuse for my bad english, it’s not my native language.
regards,
lucas