Operations Orchestration Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

ssh command

Highlighted
Occasional Contributor

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.  

 

 

8 REPLIES
Frequent Advisor

Re: ssh command

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

//Actively seeking HPOO opportunities
Occasional Contributor

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

Re: ssh command

What OS are you running the operation against?
//Actively seeking HPOO opportunities
Frequent Advisor

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

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

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

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 [Founder]

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