Need Helping Editing Perl Script for PowerChute Network Shutdown

Hi,

I found the perl script on the vmware community. The problem is that within APC's PCNS it will not let you specify parameters to run with the script.

The script requires calling on a host-list file  Usage: ./shutdownHostViaSOAPAPICall.pl [HOST_FILE]

So I would like to add the hosts I want to shutdown directly into the script instead of having to call a hostlist file.

Can anyone help with this? Here is the Vsphere thread for reference. And so that you can download the script.

https://communities.vmware.com/docs/DOC-11623

Thanks
LVL 1
tzadminAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
You need to replace this:
my $host_username = 'fillmein';
my $host_password = 'fillmein';

#### DO NOT EDIT PAST HERE ####

my @hostlist;
my ($file,$request,$message,$response,$retval,$cookie);

&verifyUserInput();
&processFile($file);

Open in new window

with this:
my $host_username = 'yourusername';
my $host_password = 'yourpass';

#### DO NOT EDIT PAST HERE ####

my @hostlist = ("host1.somedomain", ""hostx.somedomain"");
my ($file,$request,$message,$response,$retval,$cookie);

#&verifyUserInput();
#&processFile($file);

Open in new window

Basically you skip the 2 functions (verifyUserInput and processFile) and input the hosts as elements of the hostlist array.

HTH,
Dan

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tzadminAuthor Commented:
Worked like a charm. Thank you good sir!
Dan CraciunIT ConsultantCommented:
You're welcome.

Glad I could help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.