Using ProLiant Essentials Rapid Deployment Pack for scripted blade based switch configuration

pGbE.pm (Switch specific code for p-Class GbE Interconnnect Switch)
Note: Change the use line in switchconfing.pl to match the module used.
use Net::Telnet;
# Connect to the switch using the passed in switch access information
# configure the port specified by the passed in port number to the passed
# in vlan ID.
sub ConfigVlan
{
local(*switch_info) = @_[0]; # Switch login information
local(*ports) = @_[1]; # List of ports for this slot
local ($vlan) = @_[2];
local(@lines);
# Obtain switch login information.
$host = $switch_info{'host'};
$password = $switch_info{'password'};
$user = $switch_info{'user'};
# For this example we are changing NIC 2 and NIC3.
# The first port is the iLO (switch B) and PXE (switch A)
# NIC that we are not changing.
$port = $ports{'nic_2-3'};
# Set prompt to use.
my $prompt = "/>+/";
# Create Telnet access object.
$telnet = new Net::Telnet(Host => $host, Prompt => $prompt);
# Connect to the switch.
$ok = $telnet->open();
# We wait for the switch to prompt for the user/password.
$ok = $telnet->waitfor(Match => '/username:*/i');
# Log onto the switch using the user and password.
$ok = $telnet->print($user);
$ok = $telnet->waitfor(Match => '/password:*/i');
$ok = $telnet->print($password);
# Send a Return. This will be a no-operation if already in CLI mode
# and will switch to CLI if in menu mode as "switch to CLI"
# is the first item in the menu.
$ok = $telnet->print("");
$ok = $telnet->waitfor(Match => $prompt);
# Set paging mode off so the CLI is not looking for interactive commands.
$ok = $telnet->cmd("paging off");
# Set the port to operate on the specified vlan.
@tmp = $telnet->cmd("vlan create id $vlan name vlan_$vlan");
push(@lines, @tmp);
@tmp = $telnet->cmd("vlan add port id $vlan eg untagged $port");
push(@lines, @tmp);
@tmp = $telnet->cmd("vlan set pvid port $port id $vlan");
push(@lines, @tmp);
#Save the configuration change. It will be in effect even after a reboot.
@tmp = $telnet->cmd("cfg save");
push(@lines, @tmp);
$ok = $telnet->print("logout");
$telnet->close();
return @lines;
}
# Using the passed in slot number, calculate the switch port numbers
# assigned to:
# iLO (Right Switch) or PxE (Left Switch). This is nic_0-1.
# NIC3 (Right Switch) or NIC2 (Left Switch). This is nic_2-3.
sub GetPortNumbers
{
local(%switch_ports);
local($slot) = @_[0]; # Get passed in slot number
19