#!/bin/sh
#
# ex1
# BIG BROTHER EXAMPLE 1 PAGER SCRIPT FOR NON STANDARD RECIPIENT
# Robert-Andre Croteau
# Version 1.9
# Mar 13th, 2002
#
# (c) Copyright Quest Software, Inc.  1997-2002  All rights reserved.

#
# Usage: ex1
#

# The following variables are available thru the environment
# 
# BBALPHAMSG - Default message defined 
# ACKCODE - Notification associated ack code
# BBHOSTSVC - host in www.xxx.com.disk format
# BBHOSTSVCCOMMAS - host in www,xxx,com.disk format
# RCPT - recipient 
# MACHIP - IP address of host in normalized 12 digits AAABBBCCCDDD
# BBSVCNAME - name of service
# BBSVCNUM - numeric equivalent of service (from svcerrlist in bbwarnsetup.cfg)
# BBNUMERIC - ${MACHIP}${BBSVCNUM}
# BBCOLORLEVEL - Color level 
# DOWNSECSMSG - Default recovery message
# DOWNSECS - # of seconds to recovery
# RECOVERED - 1 in recovery mode, anything else non-recovery mode

#
# The RCPT value contains the real recipient value.  It was
# stripped of its ext-XXX- prefix (where XXX is what you called
# your notification script, in this example it would be ext-ex1-<recipient>)
#

if [ "$BBTMP" = "" ]
then
	echo "BB environment not set !!!"
	exit 1
fi

#
# Send the equivalent mail message  as in the basic notification
#

echo "${BBALPHAMSG}" | $MAIL "!BB - ${ACKCODE}! $BBHOSTSVC - $BBNUMERIC" "$RCPT"

exit 0
