Server Automation Practitioners Forum
cancel

CLI or Script for removing Server in HPSA

Highlighted
heckenbichler
New Member.

CLI or Script for removing Server in HPSA

Hello,

 

I have to realize a decommission workflow and I have to make the automation for this workflow step.

 

So I'm looking for a script (Perl, Python, ...) or a CLI Command (Powershell or anything else) which allows me to deactivate and remove a Server from HPSA.

 

Can anybody help me or give me a hint?

 

Best regards

Robert

3 REPLIES
DBR
Outstanding Contributor.

Re: CLI or Script for removing Server in HPSA

Use OGFS API commands.

 

cd /opsw/api/com/opsware/server/ServerService/method
        hpsa_device_id=`./getServerVO self:n=$hpsa_device | grep mid | awk '{print $2}' FS="\""`
        ./decommission self:i=$hpsa_device_id
        ./remove self:i=$hpsa_device_id

 

Don

 

Bhaskar39
Contributor.

Re: CLI or Script for removing Server in HPSA

Hi,

Can anyone please help me on how run commands in HP SA. I have a requirement where in I need to run commands to created the Device groups and run scripts dynamically. I need APIs/Web Service or any CLIs for to perform the same.

 

Thanks and Regards

Bhaskar.D

mohitrao2007
New Member.

Re: CLI or Script for removing Server in HPSA

Hi Bhaskar,

 

You can use pywist or WSDL for doing the same. If you are using webservice,

https://<HPSAHOST>/osapi/com/opsware/script/ServerScriptService?wsdl

Inside this, there is a methd to start the script. wherein you can run the script.