HP Integrated Lights-Out 2 Management Processor Scripting and Command Line Resource Guide
6 Perl scripting
Using Perl with the XML scripting interface
The scripting interface provided enables administrators to manage virtually every aspect of the
device in an automated fashion. Primarily, administrators use tools like the cpqlocfg.exe to
assist deployment efforts. Administrators using a non-Windows client can use Perl scripts to send
XML scripts to the Lights-Out devices. Administrators can also use Perl to perform more complex
tasks than cpqlocfg.exe can perform.
This section discusses how to use Perl scripting in conjunction with the Lights-Out XML scripting
language. Perl scripts require a valid user ID and password with appropriate privileges. Sample
XML scripts for Lights-Out devices and a sample Perl script are available on the HP website at
http://www.hp.com/servers/lights-out in the Best Practices section.
XML enhancements
Previous versions of iLO 2 firmware do not return properly formatted XML syntax. If the iLO 2
firmware determines the client utility does not support the return of properly formatted XML syntax,
the following message appears:
<INFORM>Scripting utility should be updated to the latest version.</INFORM>
This message informs you to update to a later version of the CPQLOCFG scripting utility. The latest
version of CPQLOCFG is 2.28.
If you are using a utility other than cpqlocfg.exe (such as Perl), the following steps might help
ensure that the iLO 2 firmware returns properly formatted XML. You must incorporate <LOCFG
version="2.21"> into the script sent to iLO 2. You can place this tag in either the Perl script or
the XML script. Placement of this tag is important. If you place this tag in the Perl script, the tag
must be sent after <?xml version="1.0"?> and before the XML script is sent. If you place the
tag in the XML script, the tag must be placed before <RIBCL version="2.0">. If you are using
the Perl script provided by HP, you can add the bold line in the following example to return properly
formatted XML syntax.
• Perl script modification
…
# Open the SSL connection and the input file
my $client = new IO::Socket::SSL->new(PeerAddr => $host);
open(F, "<$file") || die "Can't open $file\n";
# Send the XML header and begin processing the file
print $client '<?xml version="1.0"?>' . "\r\n";
#Send tag to iLO firmware to insure properly formatted XML is returned.
print $client '<LOCFG version="2.21">' . "\r\n";
…
• XML script modification
<!-- The bold line could be added for the return of properly formatted XML. -->
<LOCFG version="2.21"/>
<RIBCL version="2.0">
<LOGIN USER_LOGIN="Adminname" PASSWORD = "password">
<!--
Add XML script here.
-->
</LOGIN>
</RIBCL>
52 Perl scripting










