Hi,
here is an example how we dit it...
In the notifications we have a entry for savegroup completion report and inside we call this script:
#!/bin/sh
# set -x
# This script is desinged to send an e-mail if (All Succeeded)
# is missing within a savegroup completion report in addition
# to the generally message logging.
#
# enter the path to this file and filename in the networker
# Savegroup Completion notification:
#
# /nsr/scripts/savegrpcomp.sh
AWK=/usr/xpg4/bin/awk
TMP="/tmp/`basename $0`.$$"
LOGFILE="/nsr/logs/savegrp.log"
MAILCMD="/usr/bin/mailx"
GREP="/usr/bin/egrep"
MAILTO="user@domain.xx"
ERRTO="user@domain.xx"
MSG='--- Unsuccessful Save Sets ---'
MAILSUBJECTOK="Backup OK"
MAILSUBJECTERR="!!! Error!!!"
cat > $TMP
cat $TMP >> $LOGFILE
# Get the group name and reason out of the message
GROUP=`head -4 $TMP | $GREP "NetWorker savegroup:" | sed -e 's/, total.*//' -e 's/^.*) //'`
$GREP -e "$MSG" < $TMP > /dev/null 2>&1
if [ $? -eq 0 ]
then
# Fehler
mailx -s "${GROUP}: $MAILSUBJECTERR" "$ERRTO" "$MAILTO" < $TMP
else
# Alles OK
mailx -s "${GROUP}: $MAILSUBJECTOK" "$MAILTO" < $TMP
fi
rm $TMP
# Manage the logfile
logadm -c -z 0 ${LOGFILE}
Cheers Novelli
Novell Master CNE + CDE
EMC Networker LCNS