In our environment, we regularly add new clients. We prefer a single client per policy, so adding clients actually becomes fairly trivial with the creation of a couple of template policies and a shell script.
The template policies contain our standard schedules and windows and I have one for Unix clients (Standard policy type, Cross mount points off) and one for Windows clients (MS-Windows, Cross Mount points on).
I don't mind sharing the script but it's so site-specific that I'd rather say what it does and let you write your own based on the theory rather than post and have you pull your hair out trying to figure out what exaclty I'm doing. I'll include snippets you can use though.
We have a dedicated backup network so my script only needs the short name of the host and appends on the backup net subdomain.
The first thing the script does is lower-case the client name (this is used for the policy name) and to try and ping the client (but you could use bpclntcmd if you want). You'd be surprised how many times an admin forgets to configure the backup interface on the client. So get this right off the bat.
The next thing it does is to try and figure out what subnet it is on so I can figure out what media server to use.
# get 1st three octets of address (simplistic network number)
net=`dig +short $CLIENT.bck.mrll.com | tail -1 | awk -F. '{print $1"."$2"."$3}'`
Give the first 3 parts of the subnet, I set the storage unit.
Next, I check the patchlevel of the client. Yes, admins sometimes throw on old versions of the software or the software was installed a long time but no policy was created. If this happens, I reject addng the policy until the client can get updated. May as well start with something I can trust. And I've seen admin put on a NEWER version than my master has! Naturally you can't have that either.
PATCHLEVEL=`bpgetconfig -s $CLIENT.bck.mrll.com -A -L | awk '/Patch/ {print $4}'`
if [ $PATCHLEVEL != "6.5.4" -a $PATCHLEVEL != "6.5.5" ]
then
echo "Version $PATCHLEVEL is not supported"
echo "Client is not running 6.5.4 or 6.5.5. Aborting..."
exit 1
fi
You then need the hardware and os to figure things out, but the clients report things differently for Unix than they do for Windows.
hardware=`bpgetconfig -s $CLIENT.bck.mrll.com -A -L | awk '/Platform/ {print $5}' | cut -f1 -d,`
os=`bpgetconfig -s $CLIENT.bck.mrll.com -A -L | awk '/Client OS/ {print $4}'`
if [ $os = "Linux" -o $os = "SunOS" ]
then
os=`bpgetconfig -s $CLIENT.bck.mrll.com -A -L | awk '/Platform/ {print $6}'`
For Windows2008 clients, I forget the client to have open files enabled (I've seen status 13 errors if I do not do this)
if [ $os = "Windows2008" ]
then
bpclient -client $CLIENT.bck.mrll.com -add -WOFB_enabled 1 -WOFB_FIM 1
fi
Next, I create the policy and set the effective date to be right now. That helps me in the future if I want to know when the policy was created.
bppolicynew $CLIENT -sameas $TEMPLATE
bpplinfo $CLIENT -modify -ef "`date \"+%m/%d/%Y %H:%M:%S\"`" -residence $stu
Almost done...
Now I add the client so we get the right hardware and os.
bpplclients $CLIENT -add $CLIENT.bck.mrll.com $hardware $os
Lastly, using bpsetconfig -h, I push out a new server list to each new client so they have a current set of media servers. That way my admins don't need to keep track of my media servers and I prevent the status 59 errors that I would otherwise get.
With all of this in place, if I get a request to add a new client to my backup rotation, it's a simple matter of:
# /usr/openv/local/bin/newclient.sh <client>
and I'm done.