HP iLO 4 Scripting and Command Line Guide
READLOOP:
while(1)
{
$n++;
$reply .= $lastreply;
$lastreply = Net::SSLeay::read($ssl);
die_if_ssl_error("ERROR: ssl read");
if($lastreply eq "")
{
sleep(2); # wait 2 sec for more text.
$lastreply = Net::SSLeay::read($ssl);
last READLOOP if($lastreply eq "");
}
sleep(2); # wait 2 sec for more text.
$lastreply = Net::SSLeay::read($ssl);
last READLOOP if($lastreply eq "");
}
print "READ: $lastreply\n" if $debug;
if($lastreply =~ m/STATUS="(0x[0-9A-F]+)"[\s]+MESSAGE='(.*)
'[\s]+\/>[\s]*(([\s]|.)*?)<\/RIBCL>/)
{
if($1 eq "0x0000")
{
print STDERR "$3\n" if $3;
}
else
print STDERR "ERROR: STATUS: $1, MESSAGE: $2\n";
{
}
}
}
$reply .= $lastreply;
closeSSLconnection($ssl);
return $reply;
}
PERL scripts can also send a portion of the XML script, wait for the reply, and send more XML later.
Using this technique, it is possible to use the reply produced by an earlier command as input to a
later command. However, the PERL script must send data within a few seconds or the device times
out and disconnects.
When using the XML scripting interface with PERL scripts, the following restrictions apply:
• PERL scripts must send the XML header before sending the body of the script.
• PERL scripts must provide script data fast enough to prevent the device from timing out.
• Only one XML document is allowed per connection, which means one pair of RIBCL tags.
• The device does not accept additional XML tags after a syntax error occurs. To send additional
XML, a new connection must be established.
Sending the XML header and script body 195










