cancel
Showing results for 
Search instead for 
Did you mean: 

checking number of policies using any SLP

rk1074
Level 6
Partner

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6

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!)

View solution in original post

14 REPLIES 14

rk1074
Level 6
Partner

anyone?

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

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>" 

rk1074
Level 6
Partner

Hello Marianne,

 

it  will list all the policy names along with the SLP . ineed only those using nay particular SLP

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

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.

 

Andy_Welburn
Level 6

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!)

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

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

 

 

rk1074
Level 6
Partner

Thanks Granny and Andy :) you guys are TRUE SAVIOUR!!!

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
Please mark Andy's post as Solution.

rk1074
Level 6
Partner

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
$

 

Andrew_Madsen
Level 6
Partner

What is in /tmp/slp and how is it produced?

rk1074
Level 6
Partner

its contans all  the SLP names using  specific DD box as storage

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
I will test your script tomorrow (if time permits).

Andy_Welburn
Level 6

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......

Andrew_Madsen
Level 6
Partner

Try:

"bppllist -allpolicies -U | egrep ""Policy Name|$i"" | awk '/Residence.*"$i"/{print x};{x=$3}'"

I got this to work in a script.