EasyManuals Logo

HP P2000 G3 Cli Reference Guide

HP P2000 G3
532 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #17 background imageLoading...
Page #17 background image
HP P2000 G3 MSA System CLI Reference Guide 17
if ( !cLogin($ipAddr, $username, $password) == 1 )
{
print("Error: $username user failed to log in. Exiting.\n");
$telnet->close;
exit(0);
}
For scripting support, the following command can be used to access the XML API and to disable the
paging mode that pauses for each full screen of command output.
$telnet->cmd("set cli-parameters api-embed pager disabled");
The following code segment shows how to get the entire configuration information from the CLI and print
the output. The output can easily be redirected to a file for archiving.
@sV = $telnet->cmd("show configuration");
for ($i=0; $i<scalar(@sV); $i++)
{
print ("@sV[ $i ]");
}
Because basic command-line semantics provide prompts for user input and response time is indeterminate,
scripts must use an “expect”-type mechanism to scan output for prompts. It is more efficient to use the HTTP
interface to access the XML API. The following example shows how to construct a Perl script to
communicate with the XML API via HTTP.
use LWP::UserAgent;
use Digest::MD5 qw(md5_hex);
use XML::LibXML;
# generate MD5 hash using default username/password
my $md5_data = "manage_!manage";
my $md5_hash = md5_hex( $md5_data );
print "$md5_hash\n";
# create the URL and send an http GET request
$ua = LWP::UserAgent->new;
$url = 'http://10.0.0.2/api/login/' . $md5_hash;
print ("Sending to $url\n");
$req = HTTP::Request->new(GET => $url);
$res = $ua->request($req);
# Parse the XML content using LibXML to obtain the session key
print $res->content;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_string( $res->content );
my $root = $doc->getDocumentElement;
my @objects = $root->getElementsByTagName('OBJECT');
my @props = $objects[0]->getElementsByTagName('PROPERTY');
my $sessionKey;
foreach my $prop ( @props ) {
my $name = $prop->getAttribute('name');
print "Property = " . $name . "\n";

Table of Contents

Other manuals for HP P2000 G3

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP P2000 G3 and is the answer not in the manual?

HP P2000 G3 Specifications

General IconGeneral
ModelP2000 G3
CategoryStorage
Drive SupportSAS, SATA
Host InterfaceiSCSI, Fibre Channel, SAS
Form Factor2U
RAID Levels0, 1, 5, 6, 10
Cache2 GB
Drive Bays12 (SFF), 24 (SFF), 12 (LFF)
Cache Memory2GB per controller
Operating Temperature10°C to 35°C
Power SupplyRedundant
Expansion OptionsDisk Enclosures

Related product manuals