HP 2000fc Hp StorageWorks 2000 Family Modular Smart Array CLI reference guide - Page 18
The example below and continuing on the next shows how to construct a script - modular smart array controller
View all HP 2000fc manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 18 highlights
The example below and continuing on the next page shows how to construct a script using a Perl library for telnet communication. use Net::Telnet; $mVer = "v.072006"; $mLine mStr = "Management Controller System Cloning Utility"; $nLine = "\n"; $cliDumpFile = "get_config_dump.txt"; $space = ' '; $username = ""; $password = ""; sub cLogin { $telnet->open($_[0]); $telnet->waitfor(/(login|username)[: ]*$/i); $telnet->print("$_[1]"); $telnet->waitfor(/password[: ]*$/i); $telnet->print("$_[2]"); # either got a login or a prompt @ok = $telnet->waitfor(/(#|login:*) /i); if ($debug_comamnds == 1) { print "-"; print @ok; print "-\n"; } if ($ok[1] =~ m/login/gi) { return 0; } else { return 1; } } $ipAddr = $ARGV[0]; $username = $ARGV[1]; $password = $ARGV[2]; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt => '/\# $/i'); if ( !cLogin($ipAddr, $username, $password) == 1 ) { print("Error: $username user failed to log in. Exiting.\n"); $telnet->close; exit(0); } 18 HP StorageWorks 2000 Family Modular Smart Array CLI reference guide • May 2008