Veritas-bu

[Veritas-bu] Pending request for Tape

2005-11-03 12:07:27
Subject: [Veritas-bu] Pending request for Tape
From: scottd AT HanoverDirect DOT com (Deiter Scott)
Date: Thu, 3 Nov 2005 12:07:27 -0500
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_000_01C5E098.9A3B3730
Content-Type: multipart/alternative;
        boundary="----_=_NextPart_001_01C5E098.9A3B3730"


------_=_NextPart_001_01C5E098.9A3B3730
Content-Type: text/plain

Here is the script we use.  Of course there are three running.  One for each
site where the operators are located near

the media servers.  We have cron run this every 20 minutes.

 

-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu] On Behalf Of Vikash 
Gupta
Sent: Thursday, November 03, 2005 9:13 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Pending request for Tape

 

Hi,

 

 

I need some sort of notification email from NetBackup server side when there
is a pending request for Tape.

 

This is required because while doing the restore NetBackup gives huge list
of tapes and I know it's bogus list. 

 

This email will help us the NetBackup admins to quickly looks for the tapes
and deposit them.

 

How can I do the above activity ?

 

Thanks & Regards

Vikash Gupta

 

 


------_=_NextPart_001_01C5E098.9A3B3730
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Here is the script we use.&nbsp; Of course
there are three running.&nbsp; One for each site where the operators are located
near</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>the media servers.&nbsp; We have cron run 
this
every 20 minutes.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu] <b><span 
style='font-weight:
bold'>On Behalf Of </span></b>Vikash Gupta<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, November 03, 2005
9:13 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
veritas-bu AT mailman.eng.auburn DOT edu<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Veritas-bu] Pending
request for Tape</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New 
Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>Hi,</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>I need some sort of notification
email from NetBackup server side when there is a pending request for 
Tape.</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New 
Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>This is required because while doing
the restore NetBackup gives huge list of tapes and I know it's bogus list. 
</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New 
Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>This email will help us&nbsp;the
NetBackup admins to quickly looks for the tapes and deposit 
them.</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New 
Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>How can I do the above activity 
?</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face="Courier 
New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>Thanks &amp; 
Regards</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face=Arial><span
style='font-size:12.0pt;font-family:Arial'>Vikash Gupta</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face="Courier 
New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face="Courier 
New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

</div>

</div>

</body>

</html>

------_=_NextPart_001_01C5E098.9A3B3730--

------_=_NextPart_000_01C5E098.9A3B3730
Content-Type: text/plain;
        name="tape_request.txt"
Content-Disposition: attachment;
        filename="tape_request.txt"

#!/bin/sh

PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
PATH=$PATH:/usr/openv/volmgr/bin:/usr/openv/local
export PATH

PENDFILE=/tmp/`basename $0`.PEND.$$
LIVEFILE=/tmp/`basename $0`.LIVE.$$
HISTFILE=/tmp/`basename $0`.HIST
TMPFILE=/tmp/`basename $0`.TMP.$$

#MAILADDR="NBUusers"

>$TMPFILE
[ ! -f $HISTFILE ] && touch $HISTFILE
#Check standalone media server for pending tape requests. 
vmoprcmd -h msvr123 -d pr | awk '$1~/[0-9]/ {print $3}' >$PENDFILE
#Check standalone media_server for status of tapes.
vmoprcmd -h msvr123 -d ds | awk '$8=="Yes"  {print $6}' >$LIVEFILE


#If PEND not in HIST then new tape - send alert
for tape in `cat $PENDFILE`
do
    #Tape PENDING - send mail
    echo "msvr123 requests tape $tape." | mailx -s "NETBACKUP ON msvr123 NEE
DS TAPE : $tape" NBOperators    
  if [ `grep -c $tape $HISTFILE` -eq 0 ]
  then
    #New tape PENDING - Track it in the TMPFILE 
    echo "$tape" >>$TMPFILE
  fi
done

#If HIST not in LIVE or PEND then tape done - else still in use
for tape in `cat $HISTFILE`
do
  if [ `grep -c $tape $LIVEFILE` -eq 0 -a `grep -c $tape $PENDFILE` -eq 0 ]
  then
    #Tape we were tracking is gone - must be done...
    echo "msvr123 is done with tape $tape." | mailx -s  "NETBACKUP ON PAFILE2K
 DONE WITH: $tape" NBOperators   

  else
    #Tape we were tracking is mounted or still pending - continue to track
    echo "$tape" >>$TMPFILE
  fi
done
mv $TMPFILE $HISTFILE
rm $LIVEFILE $PENDFILE
exit

------_=_NextPart_000_01C5E098.9A3B3730--

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