pluscarden
Programmer
I am running NW on a UNIX platform and have created a customized notification that will be invoked on Savegroup completion. This is what I have specified in the action field :
/usr/scripts/save_report.sh
The actual shell script (save_report.sh) contains the following :
#!/usr/bin/ksh
awk -f save_report.awk -
echo "script finished at $(date)" >> runreport
and the awk script itself contains the following :
BEGIN {
GROUP=""
}
/^NetWorker [Ss]avegroup/
{
GROUP=$4
if ( $0 ~ /All Succeeded/ ) {
print "" > "/home/"GROUP".ok"
exit
}
if ( $0 ~ / 0 Hostname/ && $0 ~ / 0 Failed/ && $0 !~ /aborted/ )
{
print "" > "/home/"GROUP".ok"
exit
}
{
if ( GROUP != "" ) {
print $0 >> "/home/"GROUP".notok"
}
}
The general idea is that, providing the Savegroup Notification's header line doesn't contain any fail messages, a dummy file containing the group name and the extension '.ok' will be produced. Otherwise, the entire report will be written to a file (line by line) consisting of the group name and the extension '.not ok'.
My problem is that it doesn't seem to work!
I know that the shell script is definitely getting called because there are entries in the 'runreport' file.
I am assuming the notification process passes the Savegroup Completion Message to the program specified in the action field via standard input (?). Consequently, I would have thought that the awk script would automatically read it from there. I did add the '-' at the end of the awk command to ensure it definitely reads from standard input.
Can anyone see what I am doing wrong? Is there something else I need to specify in the action field to ensure the Savegroup Notification message gets passed to my shell script?
/usr/scripts/save_report.sh
The actual shell script (save_report.sh) contains the following :
#!/usr/bin/ksh
awk -f save_report.awk -
echo "script finished at $(date)" >> runreport
and the awk script itself contains the following :
BEGIN {
GROUP=""
}
/^NetWorker [Ss]avegroup/
{
GROUP=$4
if ( $0 ~ /All Succeeded/ ) {
print "" > "/home/"GROUP".ok"
exit
}
if ( $0 ~ / 0 Hostname/ && $0 ~ / 0 Failed/ && $0 !~ /aborted/ )
{
print "" > "/home/"GROUP".ok"
exit
}
{
if ( GROUP != "" ) {
print $0 >> "/home/"GROUP".notok"
}
}
The general idea is that, providing the Savegroup Notification's header line doesn't contain any fail messages, a dummy file containing the group name and the extension '.ok' will be produced. Otherwise, the entire report will be written to a file (line by line) consisting of the group name and the extension '.not ok'.
My problem is that it doesn't seem to work!
I know that the shell script is definitely getting called because there are entries in the 'runreport' file.
I am assuming the notification process passes the Savegroup Completion Message to the program specified in the action field via standard input (?). Consequently, I would have thought that the awk script would automatically read it from there. I did add the '-' at the end of the awk command to ensure it definitely reads from standard input.
Can anyone see what I am doing wrong? Is there something else I need to specify in the action field to ensure the Savegroup Notification message gets passed to my shell script?