05.11.2012 Aufrufe

HP iLO 3 Scripting and Command Line Guide - Business Support ...

HP iLO 3 Scripting and Command Line Guide - Business Support ...

HP iLO 3 Scripting and Command Line Guide - Business Support ...

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

print "Wrote $n\n" if $debug;<br />

# write script<br />

$n = Net::SSLeay::ssl_write_all($ssl, $script);<br />

print "Wrote $n\n$script\n" if $debug;<br />

$reply = "";<br />

$lastreply = "";<br />

READLOOP:<br />

while(1)<br />

{<br />

$n++;<br />

$reply .= $lastreply;<br />

$lastreply = Net::SSLeay::read($ssl);<br />

die_if_ssl_error("ERROR: ssl read");<br />

if($lastreply eq "")<br />

{<br />

sleep(2); # wait 2 sec for more text.<br />

$lastreply = Net::SSLeay::read($ssl);<br />

last READLOOP if($lastreply eq "");<br />

}<br />

sleep(2); # wait 2 sec for more text.<br />

$lastreply = Net::SSLeay::read($ssl);<br />

last READLOOP if($lastreply eq "");<br />

}<br />

print "READ: $lastreply\n" if $debug;<br />

if($lastreply =~ m/STATUS="(0x[0-9A-F]+)"[\s]+MESSAGE='(.*)<br />

'[\s]+\/>[\s]*(([\s]|.)*?)/)<br />

{<br />

if($1 eq "0x0000")<br />

{<br />

print STDERR "$3\n" if $3;<br />

}<br />

else<br />

print STDERR "ERROR: STATUS: $1, MESSAGE: $2\n";<br />

{<br />

}<br />

}<br />

}<br />

$reply .= $lastreply;<br />

closeSSLconnection($ssl);<br />

return $reply;<br />

}<br />

PERL scripts can also send a portion of the XML script, wait for the reply, <strong>and</strong> send more XML later.<br />

Using this technique, it is possible to use the reply produced by an earlier comm<strong>and</strong> as input to a<br />

later comm<strong>and</strong>. However, the PERL script must send data within a few seconds or the device times<br />

out <strong>and</strong> disconnects.<br />

When using the XML scripting interface with PERL scripts, the following restrictions apply:<br />

• PERL scripts must send the XML header before sending the body of the script.<br />

• PERL scripts must provide script data fast enough to prevent the device from timing out.<br />

• Only one XML document is allowed per connection, which means one pair of RIBCL tags.<br />

• The device does not accept additional XML tags after a syntax error occurs. To send additional<br />

XML, a new connection must be established.<br />

Sending the XML header <strong>and</strong> script body 143

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!