05-13-2015 04:14 AM
Hello ,
I need to find the name of all the polices using any particular SLP via command line. can anyone share the command for it
Solved! Go to Solution.
05-14-2015 06:56 AM
Try this (no guarantees & don't ask me to explain it!) using Mariannes SLP as an example:
bppllist -allpolicies -U | egrep "Policy Name|AIR_DISC_2_APP" | awk '/Residence.*AIR_DISC_2_APP/{print x};{x=$3}'
(& that is for a similar requirement from a previous post by a much more seasoned script writer - cheers Martin, I kept it and deciphered it for posterity & possible future use - now I just hope it works!)
05-13-2015 05:27 AM
anyone?
05-13-2015 05:39 AM
I am trying to get access to our in-house lab server to test, but our hardware guys are in the process of moving all demo/lab equipment...
It would be something like:
bppllist -allpolicies -U | egrep "Policy Name|<SLP-NAME>"
05-13-2015 05:52 AM
Hello Marianne,
it will list all the policy names along with the SLP . ineed only those using nay particular SLP
05-14-2015 01:48 AM
It's sort-of working.
On demo Appliance, we have 4 policies and 2 SLPs.
3 Policies use one specific SLP - AIR_DISC_2_APP.
Unfortunately my command lists all policies, but the policy that does not have this SLP does have any SLP listed underneath it. (The one have marked in Italics...)
This was my command and output:
bppllist -allpolicies -U | egrep "Policy Name|AIR_DISC_2_APP"
Policy Name: DiscMaster_FS
Residence: AIR_DISC_2_APP
Policy Name: DiskMaster_Catalog
Policy Name: Softserv_VM
Residence: AIR_DISC_2_APP
Policy Name: VMLABEV_DR
Residence: AIR_DISC_2_APP
Bottom line - you can only do it by means of scripting.
A more 'seasoned' script writer may be able to help here...
There is no single NBU command to list policies used by a specific SLP.
05-14-2015 06:56 AM
Try this (no guarantees & don't ask me to explain it!) using Mariannes SLP as an example:
bppllist -allpolicies -U | egrep "Policy Name|AIR_DISC_2_APP" | awk '/Residence.*AIR_DISC_2_APP/{print x};{x=$3}'
(& that is for a similar requirement from a previous post by a much more seasoned script writer - cheers Martin, I kept it and deciphered it for posterity & possible future use - now I just hope it works!)
05-14-2015 07:23 AM
Andy to the rescue!!!
It works perfectly - only the 3 policies using the SLP are listed:
# bppllist -allpolicies -U | egrep "Policy Name|AIR_DISC_2_APP" | awk '/Residence.*AIR_DISC_2_APP/{print x};{x=$3}'
DiscMaster_FS
Softserv_VM
VMLABEV_DR
05-14-2015 10:48 PM
Thanks Granny and Andy :) you guys are TRUE SAVIOUR!!!
05-14-2015 10:57 PM
05-16-2015 08:48 AM
Hi,
When I am running this in a loop to chk for multiple SLPs,its showing nothing. Am I doing anything wrong here:
$ for i in `cat /tmp/slp`;do sudo bppllist -allpolicies -U | egrep "Policy Name|$i"| awk '/Residence.*$i/{print x};{x=$3}';done
$
05-17-2015 05:46 AM
What is in /tmp/slp and how is it produced?
05-17-2015 11:25 AM
its contans all the SLP names using specific DD box as storage
05-17-2015 11:34 AM
05-18-2015 12:07 AM
It's because the awk reads the $i variable literally in its search string /Residence.*$i/ - there is a way to read that variable in from the shell, but I'm no awk expert by any stretch of the imagination so am drawing a blank at the moment - will re-visit if I get chance......
05-19-2015 04:35 AM
Try:
"bppllist -allpolicies -U | egrep ""Policy Name|$i"" | awk '/Residence.*"$i"/{print x};{x=$3}'"
I got this to work in a script.