Veritas-bu

[Veritas-bu] Question on reporting

2002-08-09 14:49:14
Subject: [Veritas-bu] Question on reporting
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Fri, 9 Aug 2002 12:49:14 -0600
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_01C23FD5.750C00A0
Content-Type: text/plain

You can build it around the bperror command.  Here's a previuous post of
mine...

---------
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} }' | sort -u`

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: Bob Grabbe [mailto:GRABBEB AT dominos DOT com]
Sent: Friday, August 09, 2002 12:13 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Question on reporting


I'm looking for a script that would run on a Solaris 8 master server to
extract a list of files that were not backed up. I.E., if you get a
status of 1 on a backup, some way of running through all the backups
within a specified period (24 hours) and getting all the warnings
instead of having to look at each individual backup to see what files
were missed. 
I seem to remember having seen this posted some time in the last few
months, but can't find it in my old emails. 
Thanks


Bob Grabbe
Dominos Pizza LLC
734-930-3703
Fax 734-669-3703
grabbeb AT dominos DOT com
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

------_=_NextPart_001_01C23FD5.750C00A0
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] Question on reporting</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>You can build it around the bperror command.&nbsp; =
Here's a previuous post of mine...</FONT>
</P>

<P><FONT SIZE=3D2>---------</FONT>
<BR><FONT SIZE=3D2>bperror can generate reports for an =
&quot;-hoursago&quot; value.&nbsp; I generate a nightly report set to =
myself for the previous 24 hours.&nbsp; 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.&nbsp; =
</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>&nbsp;&nbsp;&nbsp; awk 'BEGIN {set=3D0 }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; { if ( $0~/media id =
[0-9][0-9][0-9][0-9][0-9][0-9] removed from media/ ) {</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
set=3D1</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
remline=3D$0 }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( =
set=3D=3D0 ) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print =
}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
else&nbsp; {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
set=3D0</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( =
$0!~/expired/ ) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; print remline</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; print $0 }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; }' &gt;$TMPFILE</FONT>
</P>

<P><FONT SIZE=3D2>if [ `wc -l $TMPFILE | awk '{print $1}'` -gt 1 ] ; =
then</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; mailx -s &quot;NB =
${hours}hr Rpt:Media Report&quot; $MAILADDR &lt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
</P>

<P><FONT SIZE=3D2>##Jobs Report</FONT>
<BR><FONT SIZE=3D2>echo &quot;## Problem Summary...&quot; =
&gt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>bperror -columns $cols -U -backstat -by_statcode =
-hoursago $hours | \</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; awk 'BEGIN =
{switch=3D0}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {if ( =
$1&gt;0 &amp;&amp; $1~/^[0-9][0-9]*$/ ) {switch=3D1}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
if ( switch=3D=3D1 ) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; if ( $1~/^[0-9][0-9]*$/ ) {print}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; count=3D0</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; while ( ++count &lt;=3D NF ) { print =
&quot;\t\t&quot; $count }</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; }</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }' =
&gt;&gt;$TMPFILE</FONT>
</P>

<P><FONT SIZE=3D2>svrlist=3D`bperror -columns $cols -U -backstat =
-by_statcode -hoursago $hours | \</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; awk 'BEGIN =
{switch=3D0}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {if ( =
$1&gt;0 &amp;&amp; $1~/^[0-9][0-9]*$/ ) {switch=3D1}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
if ( switch=3D=3D1 &amp;&amp; $1!~/^[0-9][0-9]*$/) {print} }' | sort =
-u`</FONT>
</P>

<P><FONT SIZE=3D2>echo &quot;\n## Problem Detail by server...&quot; =
&gt;&gt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>for each in $svrlist</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2>&nbsp; echo &quot;\n## Client: $each&quot; =
&gt;&gt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>&nbsp; bperror -client $each -columns $cols -U =
-problems -hoursago $hours &gt;&gt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>done</FONT>
</P>

<P><FONT SIZE=3D2>if [ `egrep -vc &quot;^ *$|^#&quot; $TMPFILE` -gt 0 ] =
; then</FONT>
<BR><FONT SIZE=3D2>&nbsp; mailx -s &quot;NB ${hours}hr Rpt:Problems =
Report&quot; $MAILADDR &lt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
</P>

<P><FONT SIZE=3D2>[ -f $TMPFILE ] &amp;&amp; rm -f $TMPFILE</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>

<P><FONT SIZE=3D2>------</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Bob Grabbe [<A =
HREF=3D"mailto:GRABBEB AT dominos DOT com">mailto:GRABBEB AT dominos DOT 
com</A>]</FON=
T>
<BR><FONT SIZE=3D2>Sent: Friday, August 09, 2002 12:13 PM</FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] Question on reporting</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>I'm looking for a script that would run on a Solaris =
8 master server to</FONT>
<BR><FONT SIZE=3D2>extract a list of files that were not backed up. =
I.E., if you get a</FONT>
<BR><FONT SIZE=3D2>status of 1 on a backup, some way of running through =
all the backups</FONT>
<BR><FONT SIZE=3D2>within a specified period (24 hours) and getting all =
the warnings</FONT>
<BR><FONT SIZE=3D2>instead of having to look at each individual backup =
to see what files</FONT>
<BR><FONT SIZE=3D2>were missed. </FONT>
<BR><FONT SIZE=3D2>I seem to remember having seen this posted some time =
in the last few</FONT>
<BR><FONT SIZE=3D2>months, but can't find it in my old emails. </FONT>
<BR><FONT SIZE=3D2>Thanks</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Bob Grabbe</FONT>
<BR><FONT SIZE=3D2>Dominos Pizza LLC</FONT>
<BR><FONT SIZE=3D2>734-930-3703</FONT>
<BR><FONT SIZE=3D2>Fax 734-669-3703</FONT>
<BR><FONT SIZE=3D2>grabbeb AT dominos DOT com</FONT>
<BR><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist&nbsp; -&nbsp; =
Veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu"; =
TARGET=3D"_blank">http://mailman.eng.auburn.edu/mailman/listinfo/veritas=
-bu</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C23FD5.750C00A0--

<Prev in Thread] Current Thread [Next in Thread>