Networker

Re: [Networker] Check for a group completion in a script?

2006-07-13 05:21:26
Subject: Re: [Networker] Check for a group completion in a script?
From: Daniel Rich <drich AT PDI DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 13 Jul 2006 07:03:22 -0700
I wrote a couple of status tools when I was first fighting with nmc
under 7.3.  There seems to be a  bunch of different states that don't
really show up correctly in the status attribute in nsradmin.

I think what you are doing will work as long as the jobs either complete
normally or are running.  If you have a server crash or any other reason
that causes jobs to end prematurely, you'll need to check for things
like a state of "idle" and a non-empty work-list.  If you need to parse
the work list (I do to see how many savesets are still left in each
group), it's really an ugly field; as are most of the other attributes
that contain lists of savesets.

Manel Rodero wrote:
> Yes, you're right. The "last end" attribute is blank while the backup is
> running. When I detect the change, I run my script from the client and it
> works pretty well.
>
> Thank you very much.
>
>   
>> -----Original Message-----
>> From: Legato NetWorker discussion 
>> [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On Behalf Of Stuart Whitby
>> Sent: Thursday, July 13, 2006 1:02 PM
>> To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
>> Subject: Re: [Networker] Check for a group completion in a script?
>>
>>
>> The group should be either running or idle.  I don't *think* 
>> there are any other states, though I've maybe just to see 
>> them.  The "last end" should also help with this - it'll be 
>> blank until finished rather than showing the time of the previous run.
>>  
>> You could also set up a notification script for this, 
>> configured with "Event: Savegroup; priority: Notice" to run a 
>> script which would ssh to a client and run a command, for 
>> example.  However, if this is just a one-off then you're 
>> probably simpler running from the client rather than trying 
>> to create a script to do this - identifying the group, 
>> successful/failed clients etc. and doing an action dependent 
>> on that isn't the simplest piece of scripting.
>>  
>> HTH,
>>  
>> Stuart.
>>
>> ________________________________
>>
>> From: Legato NetWorker discussion on behalf of Manel Rodero
>> Sent: Thu 13-Jul-06 10:32
>> To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
>> Subject: [Networker] Check for a group completion in a script?
>>
>>
>>
>> Hello,
>>
>> I need to do some operations tonight just after a group 
>> completion. I can't
>> use any notification nor email sent from the server because I 
>> need to check
>> for this group completion from a client.
>>
>> I'll try to use 'nsradmin' and the attributes of the group. Now I have
>> something like this:
>>
>> option hidden
>> show name;status;last start;last end
>> print type:NSR Group;name:LCFIB-Normal
>>
>> and I execute the following command:
>>
>> client$ nsradmin -i myquery
>> Hidden display option turned on
>>
>> Display options:
>>         Dynamic: Off;
>>         Hidden: On;
>>         Resource ID: Off;
>>                         name: LCFIB-Normal;
>>                   last start: "Thu Jul 13 00:30:02 2006";
>>                     last end: "Thu Jul 13 03:43:19 2006";
>>                       status: idle;
>>
>> Then I can grep, for example, last end and see if this time 
>> is before the
>> actual time or something like this. Must I continue in this 
>> line? I say this
>> because the status attribute doesn't seem to indicate that 
>> the group has
>> finished, isn'it?
>>
>> Any other idea would be very appreciated.
>>
>> Thank you very much.
>>
>> --
>>
>> o o o  Manel Rodero                   | LCFIB - UPC
>> o o o  Systems Manager                | Campus Nord - Modul B6
>> o o o  Laboratori de Calcul           | Jordi Girona, 1-3
>> U P C  Facultat Informatica Barcelona | 08034 Barcelona (Spain)
>>                                       |
>>        manel AT fib.upc DOT edu              | Tel: +00 34 93 401 6940
>>        http://www.fib.upc.edu/~manel  | Fax: +00 34 93 401 7040
>>     

-- 
Dan Rich <drich AT pdi DOT com>
          PDI Dreamworks |  "Step up to red alert!"  "Are you sure, sir?
           (650)562-9018 |   It means changing the bulb in the sign..."

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
wit 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

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