Deactivating a client
Hi,
sometimes it's necessary to deactivate a client for some time. NetBackup doesn't make this easy for us admins, since there is no such option in the GUI. The most common way is to delete the client from the policies and put it back in later.
The definition of clients per policy can be found in the file system of your NetBackup master in /usr/openv/netbackup/db/class/ - so this is a possibility to fiddle around when deactivating a client. Editing the files directly with an editor is not a good idea - as you will notice there are checksums at the end of each file. The client name can be changed with the command "bpplclients <policy> -rename <oldname> <newname>". When you change the name of the client from "<client>" to "#<client" the client is commented out in the configuration file and no backups will be scheduled. The bad thing is, you will not see this client in the GUI.
To make all this a little easier i wrote three little scripts.
To switch a client off in all policies use the first one. Partial client names can be uses, all matching clients will be disabled:
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo " Usage: $0 <client_in_question>"
exit 1
fi
for i in `ls /opt/openv/netbackup/db/class`
do cat /opt/openv/netbackup/db/class/$i/clients 2> /dev/null | grep -v VMD5_DIGEST | grep -i $1 &> /dev/null
if [ "${?}" != 1 ] ; then
for j in `cat /opt/openv/netbackup/db/class/$i/clients |awk '{print $1}'| grep -i $1`
do
`cat /opt/openv/netbackup/db/class/$i/clients | grep -i $j | grep -v VMD5_DIGEST | grep -v '^#' | awk '{print "bpplclients '''$i''' -rename " $1 " #"$1}'`
done
fi
done
Now you're able to disable clients. Enabling them is a little more difficult, because NetBackup "thinks" this client does not exist in the policy and cannot be renamed. So I remove the # from the configuration file and then rename the client again to get the checksum right:
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo " Usage: $0 <client_in_question>"
exit 1
fi
for i in `ls /opt/openv/netbackup/db/class`
do cat /opt/openv/netbackup/db/class/$i/clients 2> /dev/null | grep -v VMD5_DIGEST | grep '^\#' | grep -i $1 &> /dev/null
if [ "${?}" != 1 ] ; then
for j in `cat /opt/openv/netbackup/db/class/$i/clients |awk '{print $1}'| grep -i $1`
do
client=`echo ${j} | sed 's/\#//'`
cp /opt/openv/netbackup/db/class/$i/clients /opt/openv/netbackup/db/class/$i/clients.bak
sed -e "s/\#${client}/aus_${client}/" < /opt/openv/netbackup/db/class/$i/clients.bak > /opt/openv/netbackup/db/class/$i/clients
bpplclients $i -rename aus_${client} ${client}
done
fi
doneOK, the last script is for finding out which policies a client is in. Called with the parameter '#' (include the single quotes!) you will get all the disabled clients. This works just as well by using bppllist -byclient, but way faster:
#!/bin/bash
if [[ $# -ne 1 ]] then echo " Usage: $0 <client_in_question>" exit 1 fi printf "\nClient\t\tTyp\tOS\t\tPolicy\n-----------------------------\n" for i in `ls /opt/openv/netbackup/db/class` do cat /opt/openv/netbackup/db/class/$i/clients 2> /dev/null | grep -v VMD5_DIGEST | grep -i $1 &> /dev/null if [ "${?}" = 0 ] ; then for j in `cat /opt/openv/netbackup/db/class/$i/clients |awk '{print $1}'| grep -i $1` do printf "`cat /opt/openv/netbackup/db/class/$i/clients | grep -v VMD5_DIGEST | grep -i $j | awk '{print $1" "$2" "$3" '''$i'''"}'`\n" echo ----------------------------- done fi done
Comments 4 Comments • Jump to latest comment
Why dont you move the clients(need to be disabled) to a different policy and deactive that policy alone?
use Policy deactivate option.
Thanks, Karthikeyan Sundaram.
we use multiple policies per client. This way it's easier to get the client back in the right policies.
Thanks Frerk for sharing.
I have been doing it like Karthikeyan. I make a copy of the active policy to policy_SAVE and remove the client from the active policy. Later I delete the active policy and copy the policy_SAVE back to the original active policy name.
I prefer the scipts that Frerk shared. Especially the third one that can be modified to send daily email notifications of each client that has been deactivated along with a date/time when it was deactivated.
.
Bob really good job. but how i can deactivate client on windows?
Regards, Taqadus Rehman
Would you like to reply?
Login or Register to post your comment.