473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

switch port enable disable

Hello, can you please suggest me how to write a perl program to enable and disable brocade switch
Sep 12 '11 #1
4 3987
It is a 16-port brocade switch.And it supports a telnet port. Like my configuration is 2hosts connected to 16port switch and inturn it is connected to array controller. And i need to write a perl script to start IO on both the hosts and disable enable the switch ports. Can you please help me??
Sep 13 '11 #3
RonB
589 Expert Mod 512MB
What have you tried?

Assuming you actually have a test script, what errors/warnings are you receiving?

What part of the process do you not know how to do?
Sep 13 '11 #4
check this perl script is correct??
#( To disable and enable the switch Ports using PERL script )

#Switch:
#Zone A: Ports 1-3-11
#Zone B: Ports 2-4-13

#HostA:
#HBA1 to ZoneA
#HBA2 to ZoneB

#HostB:
#HBA1 to ZoneA
#HBA2 to ZoneB

#ControllerA:
#HostPort1 to ZoneA

#controllerB:
#HostPort2 to ZoneB

#************************************************* **************************


#!/usr/bin/perl

use strict;

use warnings;

use Net::Telnet();

my $t=new Net::Telnet(Timeout=>10);

$t->login(my $username, my $passwd);

#step1:create volumes

#step2:Start IO from both Hosts.
#please manually start I/O from both the hosts

#step3: Disable and enable the switch ports

{

print "please enter the switchID \n";
my $switchID=<STDIN>;
print "please enter the switchuserName and switchPassword \n";
my $switchUserName=<STDIN>;
my $switchuserPwd=<STDIN>;

}

#Substitute to disable the port of the Switch for Brocade

{

print "enter the commmand \n";
my $command=<STDIN>;
print "enter the port num to disable on switch \n";
my $portNumber=<STDIN>;

}

# Substitute to enable the port of the Switch for Brocade

{
print "enter the commmand \n";
my $command=<STDIN>;
print "enter the port num to enable on switch \n";
my $portNumber=<STDIN>;
}


#substitute Sleep

# Subsuite to wait after port Disable or Enable

{

sleep(300);

}

#substitute portDisableEnableBrocade


#Disable port1 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portDisable***;
print "enter the port num to disable on switch \n";
my $portNumber=***1***;
sleep(60);

}

#Disable port3 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to disable on switch \n";
my $portNumber=***3***;
sleep(60);

}

#Enable port3 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portEnable***;
print "enter the port num to Enable on switch \n";
my $portNumber=***3***;
sleep(60);

}

#Enable port1 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to Enable on switch \n";
my $portNumber=***1***;
sleep(60);

}


#Disable port2 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portDisable***;
print "enter the port num to disable on switch \n";
my $portNumber=***2***;
sleep(60);

}

#Disable port4 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to disable on switch \n";
my $portNumber=***4***;
sleep(60);

}

#Enable port2 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portEnable***;
print "enter the port num to Enable on switch \n";
my $portNumber=***2***;
sleep(60);

}

#Enable port4 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to Enable on switch \n";
my $portNumber=***4***;
sleep(60);

}

#Disable port11 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portDisable***;
print "enter the port num to disable on switch \n";
my $portNumber=***11***;
sleep(60);

}

#Disable port13 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to disable on switch \n";
my $portNumber=***13***;
sleep(60);

}

#Enable port11 and sleep 60 seconds

{

print "enter the commmand \n";
my $command="***portEnable***;
print "enter the port num to Enable on switch \n";
my $portNumber=***11***;
sleep(60);

}

#Enable port13 and sleep 60seconds

{

print "enter the command \n";
my $command="***portDisable***;
print"enter the port num to Enable on switch \n";
my $portNumber=***13***;
sleep(60);

}
#************************************************* **********************

#THE END

#************************************************* ************************
Sep 13 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
2
by: HolaGoogle | last post by:
Can you please tell me the right way to do this?? it's realy important! thanks in advance... Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have...
3
by: Bob Bedford | last post by:
I've this code: function checkdate(FormSubmit){ alert(document.getElementById('Mois').value); if(eval(document.getElementById('Mois'))>0 && eval(document.getElementById('Annee'))>0){...
3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
0
by: Big John | last post by:
I have not been able to successfully code a toggle button to enable /disable a record filter on a form.... I have been able to put seperate a button that will enable a record filter but cannot get...
2
by: Dntc | last post by:
Hi All Is there anyway to enable/disable the toolbar buttons on the fly as like in MFC which helps centralizing this process?Let's i have a toolbar button ToolbarButtonSave which can be...
2
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: -----------------------------...
1
by: Nasif | last post by:
Dear All, I can enable/disable serial port through device manager. But I have to do it through programming . How can i do that in C#? Please help. Thanks in advance Nasif
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.