Networker

Re: [Networker] Batch Client Changes

2008-03-14 16:39:02
Subject: Re: [Networker] Batch Client Changes
From: Rob Sterba <Sterba_Robert AT EMC DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 14 Mar 2008 16:27:46 -0400
Or instead of "update", you could use "append" 

example


nsradmin> . type: NSR client; name: redhat4
Current query set
nsradmin> show
Will show all attributes
nsradmin> show name; storage nodes
nsradmin> print
name: redhat4;
storage nodes: redhat4;
nsradmin> append storage nodes: nsrserverhost
storage nodes: nsrserverhost;
Append? y
updated resource id 25.0.44.2.236.10.75.71.195.214.75.152(4)
nsradmin> print
name: redhat4;
storage nodes: redhat4, nsrserverhost; 

-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On
Behalf Of Preston de Guise
Sent: Friday, March 14, 2008 12:27 PM
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: Re: [Networker] Batch Client Changes

On 15/03/2008, at 5:08 AM, tkutil wrote:

> How do I make batch changes to clients. I would like to add another  
> group membership to all of my clients.


Depends on your version of NetWorker. Using v7.2.x and below, if you  
run up the Windows GUI you can just drag a collection of clients over  
a group (from memory). I don't believe this is supported in NMC -  
certainly not pulling up NMC on a Mac pointing to GSTD running on a  
Linux host I can't get any client dragging to work... I've noticed  
another poster saying it does work, so presumably that's on Windows or  
v7.4.x.

 From the command line, it's not trivial...

Normally you can batch override changes to clients quite easily. E.g.,  
if you wanted to say, turn off scheduled backups for all clients, you  
could do something such as:

cat <<EOF | nsradmin -i -
. type: NSR client
update scheduled backup: Disabled
EOF

However, the "update" command overwrites the given field with the new  
value; this means whatever you set to update is replaced, not appended  
to.

Thus, what you would actually need to do is build a small script which  
will take the content of the existing "group" setting for a client,  
add to it, and then update the client with the new setting. So the  
procedure would be:

1. Given a list of clients and a group name
2. Invoke nsradmin and retrieve the client name/name of group, e.g.:

cat <<EOF | nsradmin -i -
show name:; group:
print type: NSR client; name: myClient
EOF

3. Capture the above output - for each client it would look similar in  
format to the following:

                         name: belle;
                        group: Staging Desktops, Staging Full;

4. Pull out the group entry, sanitise it, and append to it so you can  
do something such as:

cat <<EOF | nsradmin -i -
. type: NSR client; name: myClient
update group: Staging Desktops, Staging Full, My New Group
EOF

Note however, that if there are multiple client definitions, you'll  
also need to retrieve additional client information from nsradmin, and/ 
or customise your query, to ensure that you ONLY adjust the client  
entry that you want to modify. Using the resource identifier string is  
good for this:

cat << EOF | nsradmin -i -
show name:; group:; resource identifier:
option resource id
print type: NSR client; name: myClient
EOF

Then:

cat <<EOF | nsradmin -i -
. type: NSR client; resource identifier:  
22.0.233.16.43.209.219.69.192.168.100.6(106)
update group: Group1, Group2, Group3, etc
EOF


As always with nsradmin, test first just using print commands, and  
grab a clean copy of your /nsr/res directory in case you have to roll  
back. However in this case, the GUI is a faster way of doing these  
sorts of changes - so long as the GUI you're using can drag and drop :-)

Cheers,

Preston.


--
Preston de Guise


"Enterprise Systems Backup and Recovery: A Corporate Insurance  
Policy", due out August 15 2008:

http://www.crcpress.com/shopping_cart/products/product_detail.asp?sku=AU
6396&isbn=9781420076394&parent_id=&pc=

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