Hewlett-Packard 2000fc Reference Manual
Download Cli reference manual of HP 2000fc Adapter, Switch for Free or View it Online on All-Guides.com.
Chapter 1 Using the CLI 17
The following example shows the Perl Expect script showfree.exp that starts a
telnet session, logs into the CLI, executes a command to show free disks, and
exits the CLI:
The following shows a possible result of executing this script:
#!/usr/bin/expect
set login [lindex $argv 1]
set password [lindex $argv 2]
set host [lindex $argv 3]
set command [lindex $argv 4]
spawn telnet $host
expect "Login:"
send "$login\r"
expect "Password:"
send "$password\r"
send "$command\r"
send "exit"
expect eof
$:./showfree.exp monitor !monitor 172.22.4.245 "show disks free"
Login: monitor
Password: ********
product
System Name: Test
System Location: Lab
Version: version
# show disks free
ID Serial# Vendor Rev. State Type Size(GB) Rate(Gb/s) SP
--------------------------------------------------------------------------
3 3KN0Z0BZ00007626NM4F SEAGATE 0003 AVAIL SAS 146 3.0
6 VDK41BT4CVLPNE ATA A9BA AVAIL SATA 250 3.0
7 3KN0Z6PD00007626NLV5 SEAGATE 0003 AVAIL SAS 146 1.5
10 3KN0Z09500007626NM28 SEAGATE 0003 AVAIL SAS 146 3.0
--------------------------------------------------------------------------
# exit