Sysop E-mail notification method uses the sysmail script to compose and send the notification e-mail. Alter this script to customize the outgoing e-mail. The script is located on the following directory:
%NV_HOME%\scripts\global\sysmail.bat
$NVHOME/scripts/global/sysmail.sh
The script calls the nvsentmail utility with the -n option for "notification mode" in which the necessary parameters are obtained from the host environment. These parameters including the e-mail subject are hard-coded and cannot be customized.
A new notification method could be added that could mimic the Sysop E-mail notification method. For information regarding creating new notification method, please refer to NetVault Administrator's Guide.
Please notice that editing a script is not included with NetVault Support, so the following recommendations must be considered as best-effort support. If assistance is required modifying a script, this could be arranged as a paid engagement through NetVault Professional Service department.
The custom notification method can call a copy of the original sysmail script. The line calling nvsentmail can be edited to specify a different subject and body content. The -n option cannot be used in combination with the other options. The utility call should be modified to include at least the following options:
-d to specify the recipient
-s to customize the subject
-f to specify a text file with the e-mail message content
The body of the e-mail can be echoed to a text file on the new notification method script. To replicate the original notification e-mail, please review the following examples:
REM Compose e-mail message
@ECHO Custom NetVault Event Notification: > mailbody.txt
@ECHO Event name = '%NVEVENTNAME%' >> mailbody.txt
@ECHO Event class = '%NVEVENTCLASS%' >> mailbody.txt
@ECHO: >> mailbody.txt @ECHO %NVEVENTMSG% >> mailbody.txt
REM Call nvsendmail
SET NV_SERVERNAME="sh_backup_01"
"%NVHOME%\util\nvsendmail" -d %NVEMAIL1% -s "%NV_SERVERNAME%: %NVEVENTNAME%" -f mailbody.txt
# Compose e-mail message
echo "Custom NetVault Event Notification:" > mailbody.txt
echo "Event name = '$NVEVENTNAME'" >> mailbody.txt
echo "Event class = '$NVEVENTCLASS'\n" >> mailbody.txt
echo $NVEVENTMSG >> mailbody.txt
# Call nvsendmail
export NV_SERVERNAME="sh_backup_01"
$NVHOME/util/nvsendmail -d $NVEMAIL1 -s "$NV_SERVERNAME: $NVEVENTNAME" -f mailbody.txt
Keep customizing the script until the desired output is achieved.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center