Re: findDeviceGroupRefs filter method (156 Views)
Reply
Trusted Contributor
DBR
Posts: 210
Registered: ‎07-29-2010
Message 1 of 4 (166 Views)

findDeviceGroupRefs filter method

I am trying to do the below in a bash shell script.

 

deviceGroupShortName=$1

deviceGroupShortNameIDs=`./.findDeviceGroupRefs:i filter='{ DeviceGroupVO.shortName = $deviceGroupShortName }' | cut -d ":" -f2 | tr "\n\r" " "`

It doesn't recognize the $deviceGroupShortName variable.

 

If I had code the value it works.  Is there a workaround for this?

 

Thanks,

Don

 

Please use plain text.
HP Expert
molinabro1
Posts: 501
Registered: ‎05-09-2007
Message 2 of 4 (156 Views)

Re: findDeviceGroupRefs filter method

Hi Don,

I tried looking in latest dev reference guide and at the moment could not find anything useful. Can you please let me know the purpose of the script and in which SA version are you working with?

And how exactly are you coding the value so this can work.

Thanks!


Ed Molina
HP Cloud Solution Support Engineer

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution. Also, if you liked this post please consider providing Kudos on the left side.
Please use plain text.
Trusted Contributor
DBR
Posts: 210
Registered: ‎07-29-2010
Message 3 of 4 (154 Views)

Re: findDeviceGroupRefs filter method

Eduardo,

 

We are running version 9.14 on Linux.

 

You can create a real simple bash script.

 

#!/bin//bash

 

deviceGroupShortName=$1

deviceGroupShortNameIDs=`./.findDeviceGroupRefs:i filter='{ DeviceGroupVO.shortName = $deviceGroupShortName }' | cut -d ":" -f2 | tr "\n\r" " "`

 

Save the script and chmod 755.  When you run the script just pass into it a short name of a device group in "".

./don.ksh "Test Device Group"

 

Let me know if you have any more questions.

 

Thanks,

Don

 

Please use plain text.
Trusted Contributor
DBR
Posts: 210
Registered: ‎07-29-2010
Message 4 of 4 (151 Views)

Re: findDeviceGroupRefs filter method

Eduardo,

The purpose is to find all device groups that have the name passed into the script.

Thanks,
Don
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation