Networker

Re: [Networker] Networker 7.4.4 - monitoring clone sessions

2009-06-05 01:49:59
Subject: Re: [Networker] Networker 7.4.4 - monitoring clone sessions
From: Kit Cunningham <kit AT 4F.CO DOT NZ>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 5 Jun 2009 15:44:13 +1000
A server I support is on solaris. 
There I use a ksh script to watch sessions that would not be hard to convert
to perl or even a batch file using nsradmin with an input file.
Its gives me a quick glance at whats running and I often use to track clone
sessions.

The simple version is 

#!/bin/ksh
( /usr/sbin/nsradmin -s bupserver -i - << EOW
show session
print type:nsr
EOW
) 2>&1|while read line
do
   echo $line
done

The while read line loop concatenates lines ending in \ with following line


The growing version follows. The code is not pretty as its really only for
my purposes.
Switches are  
-c counts sessions (or more particularly lines which is slightly wrong due
to double ups on cloning/staging)
-p pg's the list.
-s ask for a string to grep ( for use in menus to be provided to other
users)
-v greps out strings using greps -v 
<string> - greps for strings via any string on the command line (e.g. clon
for cloning)

#!/bin/ksh
function getastring {
   astring=""
   /usr/bin/echo  "$1 > \c"
   read astring
}
page=cat
grepswitch=
search=yes
while getopts cspv option
do
     case $option in
     p)      page=pg;;
     c)      page="wc -l";;
     s)      search=;;
     v)      grepswitch="-v";;
     ?)     printf "Usage: %s: [-p] [-c] [-v] [-s][search string] \n"  $0
            exit 2;;
     esac
done
shift `expr $OPTIND - 1`

grepstring="cat"
[[ -n $1 ]] && grepstring="grep -i $grepswitch $*"
[[ -z $search ]] && [[ -z $1 ]] && \
   getastring "Enter a grep string, use -v <string> to exclude, leave blank
for all sessions"\
     && [[ -n $astring ]] && grepstring="grep -i $astring"
count=0
echo " +++++++++++++ listing sessions
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
( /usr/sbin/nsradmin -s bupserver -i - << EOW
show session
print type:nsr
EOW
) 2>&1|while read line
do
   let count=$count+1
   echo $line
done |$grepstring|$page

Regards
Kit


Kit Cunningham
www.krisanya.com.au
IDATATools for NetWorker

-----Original Message-----
From: Mark Davis [mailto:davism AT UWO DOT CA] 
Sent: Friday, 5 June 2009 4:34 AM
Subject: Re: Networker 7.4.4 - monitoring clone sessions

Len Philpot wrote:
>> Mark Davis 
>>
>> When running nsrclone on a list of savesets, and viewing the 
>> Monitoring/Sessions tab, and with "Show: Clone Sessions", there is no 
>> dynamic update showing the progress of the job. It simply shows the 
>> total amount to be cloned and then does not update. When the job is 
>> complete, the session disappears.
>>
>> If I run nsrwatch, I do see the dynamic update of the job:
>>
>> cloning session:19 of 59 save set(s) reading from VT600029 31 GB of 82 
> GB
>>   servername:cloning session saving to pool 'vtl3clone' (VT600036)
>>
>> Has anyone else noticed this? Is there a workaround?
> 
> If you can generate (or already know) a list of the ssids that are being 
> cloned, you can run mminfo against that list and watch the "copies" field.

> Those with only one copy are not yet cloned. The totalsize (or sumsize) 
> field will also give you a rough idea of the relative time to clone them 
> based on their size.
> 
> I realize that's not a whole lot, but it's more than nwadmin/nsrwatch will

> tell you.  :-)

Actually, I was happy with the display in nwadmin (version 7.2.2). 
nwadmin or nsrwatch at least provided a reasonable estimate of progress. 
With the new 7.4 Administration GUI, I have no idea how far the job has 
progressed. Your suggestion is a good one, but I was hoping to see a 
better presentation in the GUI.

I have noticed that if I run nsrstage on savesets, the sessions window 
does update dynamically. I should have mentioned that in my original post.

Thanks,

Mark
-- 
Mark Davis
NetWorker Support - I.T.S
University of Western Ontario
519-661-2111 x85504
email: davism AT uwo DOT ca

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type
"signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems with this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER