Re: ssh command (548 Views)
Reply
Occasional Contributor
Debra Carroll_1
Posts: 8
Registered: ‎06-23-2005
Message 1 of 9 (581 Views)

ssh command

I'm trying to pass a command using OO SH

 

showvlun | grep ${VVNAME}

 

If I run this command from the command line, I don't have any issues so I know the command works.   If I just run showvlun using OO SH then I get the output back but I want to narrow it down using "grep" rather than filters in OO.   As soon as I use the pipe, I get errors.  

 

 

Frequent Advisor
jarodb
Posts: 46
Registered: ‎06-17-2011
Message 2 of 9 (578 Views)

Re: ssh command

Debra -- could you share a screen shot of your input parameters

//Actively seeking HPOO opportunities
Occasional Contributor
Debra Carroll_1
Posts: 8
Registered: ‎06-23-2005
Message 3 of 9 (571 Views)

Re: ssh command

Couldn't get screenshot

 

Assign to Input             Required            Type                   From

 

host                                  X                  Single Value        Value:   192.168.1.41

port                                                       Single Value         Value:  22

command                         x                   Single Value         Value:   showvlun | grep ${VVNAME}

pty                                    x                   Single Value         Value:   false

username                         x                    Single Value         Value:   myUser

password                          x                    Single Value          Value:   mypassword      

timeout                                                 Single Value          Value:    9000

characterSet                                         Single Value          Value:    UTF-8

closeSession                                         Single Value           Value:   true

 

Even if I hardcode ${VVNAME} I get same error that it is in invalid option so it's not interperting the pipe or the grep.     Works from from an shh command line. 

Frequent Advisor
jarodb
Posts: 46
Registered: ‎06-17-2011
Message 4 of 9 (569 Views)

Re: ssh command

What OS are you running the operation against?
//Actively seeking HPOO opportunities
Frequent Advisor
jarodb
Posts: 46
Registered: ‎06-17-2011
Message 5 of 9 (568 Views)

Re: ssh command

It looks like it may be against a 3par cli??
Do you have an "arguments" input?
-- if so -- you could try to assign as the following
command Value: showvlun
arguments Value: |grep ${VVNAME}
//Actively seeking HPOO opportunities
Occasional Contributor
Debra Carroll_1
Posts: 8
Registered: ‎06-23-2005
Message 6 of 9 (565 Views)

Re: ssh command

It is the 3PAR CLI.   I should have mentioned I already tried the argument command and still got the return code

 

Invalid option |grep

Frequent Advisor
jarodb
Posts: 46
Registered: ‎06-17-2011
Message 7 of 9 (563 Views)

Re: ssh command

I wish I had a 3par cli to test against -- I could only suggest going the route of the OO filter...

Maybe another member will be able to assist further -- good luck!
//Actively seeking HPOO opportunities
Occasional Contributor
Lim Swee Aun
Posts: 9
Registered: ‎06-06-2010
Message 8 of 9 (550 Views)

Re: ssh command

Consider using OO filter to process the output rather than using grep.

 

Meaning, OO flow's ssh command should only execute showvlun

The entire result will be captured by that OO step.

In the Results tab, use Filters to extract the parameter/value you need.

(you can then assign it to flow variable for use in other steps)

 

You can see an example of this in:

OO Library\AcceleratorPacks\OperatingSystems\RedHat <or any unix variant>\RedHatHealthCheck

The "ping" step uses filter to extract various values from a normal ping command output.

 

 

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 9 of 9 (548 Views)

Re: ssh command

Instead of doing a grep, why not use the CLI pattern matching directly?  (Assuming you are searching for a VV.)

showvlun -v "*${VVNAME}*"

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.