[Veritas-bu] bpdbjobs
2002-07-22 19:12:20
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C231D5.3A993770
Content-Type: text/plain
bperror can generate reports for an "-hoursago" value. I generate a nightly
report set to myself for the previous 24 hours. Here's the script, the
first part generates a media report, the second part generates a summary of
backup codes (per code) then breaks it down by client.
Here's the script (note - change the mail address)
$ cat /usr/openv/local/auto_reports
#!/bin/ksh
MAILADDR=YOU AT YOURDOMAIN DOT COM
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
TMPFILE=/var/tmp/`basename $0`.tmp.$$
cols=92
hours=24
##Media Report
bperror -columns $cols -U -media -hoursago $hours | \
awk 'BEGIN {set=0 }
{ if ( $0~/media id [0-9][0-9][0-9][0-9][0-9][0-9] removed from media/ )
{
set=1
remline=$0 }
else {
if ( set==0 ) {
print }
else {
set=0
if ( $0!~/expired/ ) {
print remline
print $0 }
}
}
}' >$TMPFILE
if [ `wc -l $TMPFILE | awk '{print $1}'` -gt 1 ] ; then
mailx -s "NB ${hours}hr Rpt:Media Report" $MAILADDR <$TMPFILE
fi
##Jobs Report
echo "## Problem Summary..." >$TMPFILE
bperror -columns $cols -U -backstat -by_statcode -hoursago $hours | \
awk 'BEGIN {switch=0}
{if ( $1>0 && $1~/^[0-9][0-9]*$/ ) {switch=1}
if ( switch==1 ) {
if ( $1~/^[0-9][0-9]*$/ ) {print}
else {
count=0
while ( ++count <= NF ) { print "\t\t" $count }
}
}
}' >>$TMPFILE
svrlist=`bperror -columns $cols -U -backstat -by_statcode -hoursago $hours |
\
awk 'BEGIN {switch=0}
{if ( $1>0 && $1~/^[0-9][0-9]*$/ ) {switch=1}
if ( switch==1 && $1!~/^[0-9][0-9]*$/) {print} }'`
echo "\n## Problem Detail by server..." >>$TMPFILE
for each in $svrlist
do
echo "\n## Client: $each" >>$TMPFILE
bperror -client $each -columns $cols -U -problems -hoursago $hours
>>$TMPFILE
done
if [ `egrep -vc "^ *$|^#" $TMPFILE` -gt 0 ] ; then
mailx -s "NB ${hours}hr Rpt:Problems Report" $MAILADDR <$TMPFILE
fi
[ -f $TMPFILE ] && rm -f $TMPFILE
exit
-----Original Message-----
From: Glancey, John [CNTUS - NON J&J] [mailto:JGlancey AT CNTUS.JNJ DOT COM]
Sent: Monday, July 22, 2002 1:35 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] bpdbjobs
I am using a modified backup_exit_notify.cmd script that sends an email for
any job that finishes with an error (0,1 ignored). I would also like to
send a daily summary report for all jobs that ran the previous night.
I think that bpdbjobs -report -file (and Blat) will accomplish that, however
I only want the jobs that completed the previous night. Can I specify a
date range using bpdbjobs? If not, any suggested "workarounds"?
Using NetBackup Datacenter 3.4.1 on Windows 2000.
Thanks in advance,
John Glancey
jglancey AT cntus.jnj DOT com
------_=_NextPart_001_01C231D5.3A993770
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Veritas-bu] bpdbjobs</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>bperror can generate reports for an =
"-hoursago" value. I generate a nightly report set to =
myself for the previous 24 hours. Here's the script, the first =
part generates a media report, the second part generates a summary of =
backup codes (per code) then breaks it down by client. =
</FONT></P>
<P><FONT SIZE=3D2>Here's the script (note - change the mail =
address)</FONT>
</P>
<P><FONT SIZE=3D2>$ cat /usr/openv/local/auto_reports</FONT>
<BR><FONT SIZE=3D2>#!/bin/ksh</FONT>
</P>
<P><FONT SIZE=3D2>MAILADDR=3DYOU AT YOURDOMAIN DOT COM</FONT>
<BR><FONT =
SIZE=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin/admincmd</FONT>
<BR><FONT SIZE=3D2>TMPFILE=3D/var/tmp/`basename $0`.tmp.$$</FONT>
</P>
<P><FONT SIZE=3D2>cols=3D92</FONT>
<BR><FONT SIZE=3D2>hours=3D24</FONT>
</P>
<P><FONT SIZE=3D2>##Media Report</FONT>
<BR><FONT SIZE=3D2>bperror -columns $cols -U -media -hoursago $hours | =
\</FONT>
<BR><FONT SIZE=3D2> awk 'BEGIN {set=3D0 }</FONT>
<BR><FONT SIZE=3D2> { if ( $0~/media id =
[0-9][0-9][0-9][0-9][0-9][0-9] removed from media/ ) {</FONT>
<BR><FONT SIZE=3D2> =
set=3D1</FONT>
<BR><FONT SIZE=3D2> =
remline=3D$0 }</FONT>
<BR><FONT SIZE=3D2> else {</FONT>
<BR><FONT SIZE=3D2> if ( =
set=3D=3D0 ) {</FONT>
<BR><FONT =
SIZE=3D2> print =
}</FONT>
<BR><FONT SIZE=3D2> =
else {</FONT>
<BR><FONT =
SIZE=3D2> =
set=3D0</FONT>
<BR><FONT =
SIZE=3D2> if ( =
$0!~/expired/ ) {</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; print remline</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; print $0 }</FONT>
<BR><FONT SIZE=3D2> }</FONT>
<BR><FONT SIZE=3D2> }</FONT>
<BR><FONT SIZE=3D2> }' >$TMPFILE</FONT>
</P>
<P><FONT SIZE=3D2>if [ `wc -l $TMPFILE | awk '{print $1}'` -gt 1 ] ; =
then</FONT>
<BR><FONT SIZE=3D2> mailx -s "NB =
${hours}hr Rpt:Media Report" $MAILADDR <$TMPFILE</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
</P>
<P><FONT SIZE=3D2>##Jobs Report</FONT>
<BR><FONT SIZE=3D2>echo "## Problem Summary..." =
>$TMPFILE</FONT>
<BR><FONT SIZE=3D2>bperror -columns $cols -U -backstat -by_statcode =
-hoursago $hours | \</FONT>
<BR><FONT SIZE=3D2> awk 'BEGIN =
{switch=3D0}</FONT>
<BR><FONT =
SIZE=3D2> {if ( =
$1>0 && $1~/^[0-9][0-9]*$/ ) {switch=3D1}</FONT>
<BR><FONT =
SIZE=3D2> =
if ( switch=3D=3D1 ) {</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; if ( $1~/^[0-9][0-9]*$/ ) {print}</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; else {</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; count=3D0</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; while ( ++count <=3D NF ) { print =
"\t\t" $count }</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; }</FONT>
<BR><FONT =
SIZE=3D2> =
}</FONT>
<BR><FONT =
SIZE=3D2> }' =
>>$TMPFILE</FONT>
</P>
<P><FONT SIZE=3D2>svrlist=3D`bperror -columns $cols -U -backstat =
-by_statcode -hoursago $hours | \</FONT>
<BR><FONT SIZE=3D2> awk 'BEGIN =
{switch=3D0}</FONT>
<BR><FONT =
SIZE=3D2> {if ( =
$1>0 && $1~/^[0-9][0-9]*$/ ) {switch=3D1}</FONT>
<BR><FONT =
SIZE=3D2> =
if ( switch=3D=3D1 && $1!~/^[0-9][0-9]*$/) {print} }'`</FONT>
</P>
<P><FONT SIZE=3D2>echo "\n## Problem Detail by server..." =
>>$TMPFILE</FONT>
<BR><FONT SIZE=3D2>for each in $svrlist</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2> echo "\n## Client: $each" =
>>$TMPFILE</FONT>
<BR><FONT SIZE=3D2> bperror -client $each -columns $cols -U =
-problems -hoursago $hours >>$TMPFILE</FONT>
<BR><FONT SIZE=3D2>done</FONT>
</P>
<P><FONT SIZE=3D2>if [ `egrep -vc "^ *$|^#" $TMPFILE` -gt 0 ] =
; then</FONT>
<BR><FONT SIZE=3D2> mailx -s "NB ${hours}hr Rpt:Problems =
Report" $MAILADDR <$TMPFILE</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
</P>
<P><FONT SIZE=3D2>[ -f $TMPFILE ] && rm -f $TMPFILE</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Glancey, John [CNTUS - NON J&J] [<A =
HREF=3D"mailto:JGlancey AT CNTUS.JNJ DOT COM">mailto:JGlancey AT CNTUS.JNJ DOT
COM</A>=
]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, July 22, 2002 1:35 PM</FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] bpdbjobs</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>I am using a modified backup_exit_notify.cmd script =
that sends an email for any job that finishes with an error (0,1 =
ignored). I would also like to send a daily summary report for =
all jobs that ran the previous night.</FONT></P>
<P><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>I think that bpdbjobs -report -file (and Blat) will =
accomplish that, however I only want the jobs that completed the =
previous night. Can I specify a date range using bpdbjobs? =
If not, any suggested "workarounds"?</FONT></P>
<P><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>Using NetBackup Datacenter 3.4.1 on Windows =
2000.</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>Thanks in advance,</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>John Glancey</FONT>
<BR><FONT SIZE=3D2>jglancey AT cntus.jnj DOT com</FONT>
<BR><FONT SIZE=3D2> </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C231D5.3A993770--
|
|
|