Inserting virtual media with a helper application, Sample virtual media helper application – HP Integrated Lights-Out 4 User Manual

Page 226

Advertising
background image

Inserting Virtual Media with a helper application

When you are using a helper application with the INSERT_VIRTUAL_MEDIA command, the basic
format of the URL is as follows:

protocol://user:password@servername:port/path,helper-script

where:

protocol

—Mandatory. Either HTTP or HTTPS.

user:password

—Optional. When present, HTTP basic authorization is used.

servername

—Mandatory. Either the host name or the IP address of the web server.

port

—Optional. A web server on a nonstandard port.

path

—Mandatory. The image file that is being accessed.

helper-script

—Optional. The location of the helper script on IIS web servers.

For detailed information about the INSERT_VIRTUAL_MEDIA command, see the HP iLO 4 Scripting
and Command Line Guide
.

Sample Virtual Media helper application

The following Perl script is an example of a CGI helper application that allows diskette writes on
web servers that cannot perform partial writes. A helper application can be used in conjunction
with the INSERT_VIRTUAL_MEDIA command to mount a writable disk.

When you are using the helper application, the iLO firmware posts a request to this application
using the following parameters:

The file parameter contains the name of the file provided in the original URL.

The range parameter contains an inclusive range (in hexadecimal) that designates where to
write the data.

The data parameter contains a hexadecimal string that represents the data to be written.

The helper script must transform the file parameter into a path relative to its working directory.
This might involve prefixing it with "../," or transforming an aliased URL path into the true path on
the file system. The helper script requires write access to the target file. Diskette image files must
have the appropriate permissions.

Example:

#!/usr/bin/perl

use CGI;
use Fcntl;

#
# The prefix is used to get from the current working directory to the
# location of the image file that you are trying to write
#
my ($prefix) = "c:/inetpub/wwwroot";
my ($start, $end, $len, $decode);

my $q = new CGI(); # Get CGI data

my $file = $q->param('file'); # File to be written
my $range = $q->param('range'); # Byte range to be written
my $data = $q->param('data'); # Data to be written

#
# Change the file name appropriately
#
$file = $prefix . "/" . $file;

226 Using iLO

Advertising