Run HPSA OGFS script from the global shell (1636 Views)
Reply
Trusted Contributor
Posts: 236
Registered: ‎07-29-2010
Message 1 of 4 (1,636 Views)

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

 

Occasional Advisor
Posts: 6
Registered: ‎03-31-2010
Message 2 of 4 (1,619 Views)

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
Posts: 236
Registered: ‎07-29-2010
Message 3 of 4 (1,614 Views)

Re: Run HPSA OGFS script from the global shell

Thanks!

 

Don

 

Occasional Visitor
Posts: 3
Registered: ‎08-25-2011
Message 4 of 4 (1,593 Views)

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

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.