Server Automation Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Run HPSA OGFS script from the global shell

Trusted Contributor

Run HPSA OGFS script from the global shell

How do you run a HPSA OGFS script from the global shell.  I have a OGFS script stored in HPSA called testOO.ogfs located in / in the Library.

 

I can't figure out how to run this from the global shell.

 

Thanks!

Don

 

3 REPLIES
Occasional Advisor

Re: Run HPSA OGFS script from the global shell

Hi there.

 

One way to run an ogfs script from the global shell is:

 

cd /opsw/Library/hello-world/@/method

./.startOGFSScript\:i self:n='hello-world'  "args={timeout=60 tailOutputSize=10}"

 

the above will return a job id, which you can then view with the methods related to the job service.

 

The above example implies the name of the script: hello-world, located in the root of the software library.

 

Thank you.

 

Regards,

Csaba

 

Trusted Contributor

Re: Run HPSA OGFS script from the global shell

Thanks!

 

Don

 

Occasional Visitor

Re: Run HPSA OGFS script from the global shell

If you don't want to run it as a job that you subsequently need to get the result of, you can also do something like

cd /opsw/Library/hello-world/@/method

./getSource versionLabel=2 | sh

 

The above simply gets version 2 of the source for the script and pipes it to a shell. The output is sent straight to your global shell session

 

The following will get and execute the current version of the script source (bit clunky but it works)

cd /opsw/Library/hello-world/@/method

./getSource `cat ../attr/currentVersion | grep 'versionLabel' | tr -d '"'` | sh

 

If you need to pass parameters in to your script you can do this (even clunkier)

cd /opsw/Library/hello-world/@/method

./getSource `cat ../attr/currentVersion | grep 'versionLabel' | tr -d '"'` > /tmp/thing; sh /tmp/thing parm1 parm2 parm3

 

Thanks