08-14-2012 09:02 AM
Hi Folks,
I need to take out only active backup clients for my licence renewel process.
-->We have more then 600 clients and some of the clients is decommisoned.
---->We may forgot to remove client from the list(Summary of all backup policies).
I need only active client name,policy and client.Is there any way to take out.
Thanks,
Susi.S
Solved! Go to Solution.
08-14-2012 11:12 AM
I have another idea - you can see all deactivated policies in the GUI, right?
Make a list of the policy names, the go to /usr/openv/netbackup/db/class.
All policies are represented as folders in this directory.
Move all inactive policies to a non-NBU folder.
Best to do this with GUI closed and NBU shut down.
If you now start NBU and list clients (bpplclients -allunique .....) you will only see clients in active policies.
PS: No need to keep deactivated policies for decommissioned clients around. There is no need for policies to exist in order to perform restores.
08-15-2012 02:02 AM
Marked Mariannes post as the solution as it looked like that was the way you were intending to go, but just for completeness, & as promised, a cobbled together script using the correct commands in the right places.
Based on the command you'd already got (which I believe came from an earlier post of Martins)
for POLICY in `bppllist -U -verbose -allpolicies | egrep '^Policy Name|Active' | awk '/Active.*yes/{print x};{x=$3}'` do bpplclients $POLICY -noheader | awk '{print $3}' >> /tmp/active_clients.tmp done sort -u /tmp/active_clients.tmp rm /tmp/active_clients.tmp
[[Editted]]
08-14-2012 09:52 AM
You'll probably need something along the lines of bpplinfo to produce a list of 'Active' policies & then bpplist to list out the clients of those policies. Obviously it cannot cater for any clients that you are still backing up that you shouldn't be!
If I was at work I'd try to cobble something together but ....
08-14-2012 10:35 AM
I got some commands to list out only active policy and wantto know what & all server using that policy..Any idea..
sudo /usr/openv/netbackup/bin/admincmd/bppllist -U -verbose -allpolicies |egrep '^Policy Name|Active' |awk '/Active.*yes/{print x};{x=$0}'
Thanks,
Susi.S
08-14-2012 11:06 AM
Sorry, my mistake - said I wasn't at work got my bppl commands mixed up! - you could try using that list of active policies in conjunction with bpplclients
08-14-2012 11:12 AM
I have another idea - you can see all deactivated policies in the GUI, right?
Make a list of the policy names, the go to /usr/openv/netbackup/db/class.
All policies are represented as folders in this directory.
Move all inactive policies to a non-NBU folder.
Best to do this with GUI closed and NBU shut down.
If you now start NBU and list clients (bpplclients -allunique .....) you will only see clients in active policies.
PS: No need to keep deactivated policies for decommissioned clients around. There is no need for policies to exist in order to perform restores.
08-14-2012 12:13 PM
Thanks Marianne.This is the best way to check the details,..I am bit lazy thats why planed to go for command with script..ANy way i will take client list with use of your tips :)
08-15-2012 02:02 AM
Marked Mariannes post as the solution as it looked like that was the way you were intending to go, but just for completeness, & as promised, a cobbled together script using the correct commands in the right places.
Based on the command you'd already got (which I believe came from an earlier post of Martins)
for POLICY in `bppllist -U -verbose -allpolicies | egrep '^Policy Name|Active' | awk '/Active.*yes/{print x};{x=$3}'` do bpplclients $POLICY -noheader | awk '{print $3}' >> /tmp/active_clients.tmp done sort -u /tmp/active_clients.tmp rm /tmp/active_clients.tmp
[[Editted]]
08-15-2012 08:37 AM
Thanks Andy for your help...Perfect...
08-15-2012 11:03 AM
1st Script
Below script will produce the active policy list and deactivated policy list
#!/bin/sh
rm /tmp/classstatus
bppllist=/usr/openv/netbackup/bin/admincmd/bppllist
bpplinfo=/usr/openv/netbackup/bin/admincmd/bpplinfo
classlist=/tmp/classlist
classstatus=/tmp/classstatus
active_policy_list=/tmp/active_policy_list
deactive_policy_list=/tmp/deactive_policy_list
$bppllist > $classlist
for policy in `cat $classlist`
do
state=`$bpplinfo $policy -L | grep Active | awk '{print $2}'`
if [ "$state" = "yes" ]
then
status="Yes $policy is active"
echo "$policy" >> $active_policy_list
else
status="No $policy is not active"
echo "$policy" >> $deactive_policy_list
fi
echo "$status" >> $classstatus
done
2nd script
Below script will produce the clients from active policy list
for i in `cat /tmp/active_policy_list`;do sudo bpplclients $i -noheader | awk '{print $3}';done
08-15-2012 01:42 PM
Hi Twinkle,
It will be better.Ii prints corresponding policy name with client on the output.
Because same server having two or 3 policies suppose it should be on database client.
Thanks,
Susi.S
08-16-2012 01:28 AM
It will be better.Ii prints corresponding policy name with client on the output.
Isn't that "moving the goalposts" a little?
08-16-2012 02:45 AM
Vote the post if it works for You.