Using perl with the xml scripting interface, Xml enhancements – HP Remote Insight Lights-Out Edition II Board User Manual

Page 129

Advertising
background image

Scripting, command line, and utility options 129

Do not use this switch if launching from Systems Insight Manager.

NOTE: The output values might need to be modified to match the RIBCL syntax.

NOTE: The -L parameter cannot designate an output log file. A default log file named with the DNS name

or the IP address is created in the same directory where CPQLOCFG is launched.

-V is the optional switch that turns on the verbose message return. The resulting log file contains all
commands sent to the Remote Insight board, all responses from the Remote Insight board, and any
errors. By default, only errors and responses from GET commands are logged without this switch.

See the "Remote Insight Command Language (on page

138

)" section for information on the syntax of the

XML data files. Sample XML scripts are available on the HP website (

http://www.hp.com/servers/lights-

out

) in the Best Practices section.

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
(

http://www.hp.com/servers/lights-out

) in the Best Practices section.

XML enhancements

Previous versions of RILOE II firmware do not return properly formatted XML syntax. If the RILOE II
firmware determines the client utility being used 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 the customer to update to a later version of the cpqlocfg scripting utility. The latest
version of cpqlocfg.exe is currently 2.21.

For customers using a utility other than cpqlocfg.exe, such as Perl scripts, the following steps can help
ensure the RILOE II firmware returns properly formatted XML. Assuming the version of firmware is 1.20,

<LOCFG version="2.21">

should be incorporated into the script sent to RILOE II. This tag can be

placed in either the Perl script or the XML script. Placement of this tag is important. If placing this tag in
the Perl script, the tag should be sent after

<?xml version="1.0"?>

and before the XML script is

sent. If placing the tag in the XML script, the tag should be placed before

<RIBCL version="2.0">.

If

you are using the Perl script provided by HP, then the bold line in the following example can be added 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 RILOE II firmware to insure properly formatted XML is

returned.

Advertising