[Veritas-bu] Pending Request Notification
2002-11-06 12:23:56
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_01C285B9.494EA510
Content-Type: text/plain
I've written the following that notifies when a pending request comes in,
then renotifies when requested tape is done being used (for external
drives). It was written for my single master/media server environment. It
runs every 10 minutes from root's crontab.
I'm working on a version for my new SSO environment but it's not done yet.
-M
#!/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="YOU AT YOURDOMAIN DOT COM"
>$TMPFILE
[ ! -f $HISTFILE ] && touch $HISTFILE
vmoprcmd -d pr | awk '$1~/[0-9]/ {print $3}' >$PENDFILE
vmoprcmd -d ds | awk '$8=="Yes" {print $6}' >$LIVEFILE
#If PEND not in HIST then new tape - send alert
for tape in `cat $PENDFILE`
do
if [ `grep -c $tape $HISTFILE` -eq 0 ]
then
#New tape PENDING - Track it and send mail
echo "Netbackup requests tape $tape." | mailx -s "NB_PEND: $tape"
$MAILADDR
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 "Netbackup is done with tape $tape." | mailx -s "NB_DONE: $tape"
$MAILADDR
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
-----Original Message-----
From: Paul Boatman [mailto:boatm005 AT admin.ndis.umn DOT edu]
Sent: Wednesday, November 06, 2002 10:07 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Pending Request Notification
Hey guys,
Have any of you automated pending requests for some type of
notification ?
What process is it that will show up for a pending request ?
(description)
Are there any scripts available that will send a email automatically
for a pending request ?
Thanks,
Paul
University of Minnesota
Central Computing Operations
**************************************************************************
This e-mail and its attachments have been scanned for viruses.
NDIS - University of Minnesota
**************************************************************************
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
------_=_NextPart_001_01C285B9.494EA510
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] Pending Request Notification</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>I've written the following that notifies when a =
pending request comes in, then renotifies when requested tape is done =
being used (for external drives). It was written for my single =
master/media server environment. It runs every 10 minutes from =
root's crontab. </FONT></P>
<P><FONT SIZE=3D2>I'm working on a version for my new SSO environment =
but it's not done yet. </FONT>
</P>
<P><FONT SIZE=3D2>-M</FONT>
</P>
<P><FONT SIZE=3D2>#!/bin/sh</FONT>
</P>
<P><FONT =
SIZE=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/=
admincmd</FONT>
<BR><FONT =
SIZE=3D2>PATH=3D$PATH:/usr/openv/volmgr/bin:/usr/openv/local</FONT>
<BR><FONT SIZE=3D2>export PATH</FONT>
</P>
<P><FONT SIZE=3D2>PENDFILE=3D/tmp/`basename $0`.PEND.$$</FONT>
<BR><FONT SIZE=3D2>LIVEFILE=3D/tmp/`basename $0`.LIVE.$$</FONT>
<BR><FONT SIZE=3D2>HISTFILE=3D/tmp/`basename $0`.HIST</FONT>
<BR><FONT SIZE=3D2>TMPFILE=3D/tmp/`basename $0`.TMP.$$</FONT>
</P>
<P><FONT SIZE=3D2>MAILADDR=3D"YOU AT YOURDOMAIN DOT COM"</FONT>
</P>
<P><FONT SIZE=3D2>>$TMPFILE</FONT>
<BR><FONT SIZE=3D2>[ ! -f $HISTFILE ] && touch $HISTFILE</FONT>
<BR><FONT SIZE=3D2>vmoprcmd -d pr | awk '$1~/[0-9]/ {print $3}' =
>$PENDFILE</FONT>
<BR><FONT SIZE=3D2>vmoprcmd -d ds | awk '$8=3D=3D"Yes" =
{print $6}' >$LIVEFILE</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>#If PEND not in HIST then new tape - send =
alert</FONT>
<BR><FONT SIZE=3D2>for tape in `cat $PENDFILE`</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2> if [ `grep -c $tape $HISTFILE` -eq 0 ]</FONT>
<BR><FONT SIZE=3D2> then</FONT>
<BR><FONT SIZE=3D2> #New tape PENDING - Track it and =
send mail</FONT>
<BR><FONT SIZE=3D2> echo "Netbackup requests =
tape $tape." | mailx -s "NB_PEND: $tape" =
$MAILADDR</FONT>
<BR><FONT SIZE=3D2> echo "$tape" =
>>$TMPFILE</FONT>
<BR><FONT SIZE=3D2> fi</FONT>
<BR><FONT SIZE=3D2>done</FONT>
</P>
<P><FONT SIZE=3D2>#If HIST not in LIVE or PEND then tape done - else =
still in use</FONT>
<BR><FONT SIZE=3D2>for tape in `cat $HISTFILE`</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2> if [ `grep -c $tape $LIVEFILE` -eq 0 -a `grep =
-c $tape $PENDFILE` -eq 0 ]</FONT>
<BR><FONT SIZE=3D2> then</FONT>
<BR><FONT SIZE=3D2> #Tape we were tracking is gone - =
must be done...</FONT>
<BR><FONT SIZE=3D2> echo "Netbackup is done with =
tape $tape." | mailx -s "NB_DONE: $tape" =
$MAILADDR</FONT>
<BR><FONT SIZE=3D2> else</FONT>
<BR><FONT SIZE=3D2> #Tape we were tracking is mounted =
or still pending - continue to track</FONT>
<BR><FONT SIZE=3D2> echo "$tape" =
>>$TMPFILE</FONT>
<BR><FONT SIZE=3D2> fi</FONT>
<BR><FONT SIZE=3D2>done</FONT>
<BR><FONT SIZE=3D2>mv $TMPFILE $HISTFILE</FONT>
<BR><FONT SIZE=3D2>rm $LIVEFILE $PENDFILE</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Paul Boatman [<A =
HREF=3D"mailto:boatm005 AT admin.ndis.umn DOT edu">mailto:boatm005 AT admin DOT
ndis.u=
mn.edu</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, November 06, 2002 10:07 AM</FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] Pending Request =
Notification</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hey guys,</FONT>
</P>
<P><FONT SIZE=3D2>Have any of you automated pending requests for some =
type of</FONT>
<BR><FONT SIZE=3D2>notification ?</FONT>
</P>
<P><FONT SIZE=3D2>What process is it that will show up for a pending =
request ?</FONT>
<BR><FONT SIZE=3D2>(description)</FONT>
</P>
<P><FONT SIZE=3D2>Are there any scripts available that will send a =
email automatically</FONT>
<BR><FONT SIZE=3D2>for a pending request ?</FONT>
</P>
<P><FONT SIZE=3D2>Thanks,</FONT>
</P>
<P><FONT SIZE=3D2>Paul </FONT>
</P>
<P><FONT SIZE=3D2>University of Minnesota</FONT>
<BR><FONT SIZE=3D2>Central Computing Operations</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><FONT =
SIZE=3D2>***************************************************************=
***********</FONT>
<BR><FONT SIZE=3D2>This e-mail and its attachments have been scanned =
for viruses.</FONT>
<BR><FONT SIZE=3D2>NDIS - University of Minnesota </FONT>
<BR><FONT =
SIZE=3D2>***************************************************************=
***********</FONT>
</P>
<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist - =
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_01C285B9.494EA510--
|
|
|