Controlling Cisco Switch from WD

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

Controlling Cisco Switch from WD

Postby djrappa » Tue Nov 07, 2017 6:31 am

Hi
I have an application where I need to reconfigure the VLAN assignment of a cisco switch port on the fly.

I need to be able to this from within Widget Designer. Does anyone know of a way I could send commands to the Cisco SG500 switch from Widget Designer to achieve this?

Usually control of the switch settings is via a web interface or via Telnet...
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am

Re: Controlling Cisco Switch from WD

Postby Dennis Kuypers » Tue Nov 07, 2017 2:01 pm

Hello,

try to do whatever you need to do with putty or another console application that connects via telnet and then you can port it to the widget designer.

Regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Controlling Cisco Switch from WD

Postby djrappa » Tue Nov 07, 2017 10:59 pm

Can you elaborate further as to what you mean by 'port it to WD'?
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am

Re: Controlling Cisco Switch from WD

Postby justyn roy » Wed Nov 08, 2017 1:00 am

Create a Connection in WD with the Port and address that works in Putty.

Use scripts to send the same commands that work in Putty from WD.
Justyn Roy

Online Manual
User avatar
justyn roy
 
Posts: 132
Joined: Tue Sep 27, 2016 1:26 am

Re: Controlling Cisco Switch from WD

Postby djrappa » Wed Nov 08, 2017 3:19 am

Ah yes that makes total sense... wasn't sure if Porting was literally meaning Port in this case.
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am

Re: Controlling Cisco Switch from WD

Postby Dennis Kuypers » Wed Nov 08, 2017 12:14 pm

Hello,

I was saying that you should find out what you have to do in putty to get the results you want and then do the same in WD.

ex.: In putty you do
Code: Select all
{DoStuff}<press enter>


then in WD you do
Code: Select all
TCPSend(1, "{DoStuff}\n")



Dennis

I wasn't referring to a "network port", i meant this:
verb: port; 3rd person present: ports; past tense: ported; past participle: ported; gerund or present participle: porting
1. COMPUTING
transfer (software) from one system or machine to another.
"the software can be ported to practically any platform"
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Controlling Cisco Switch from WD

Postby djrappa » Fri Nov 24, 2017 12:42 pm

Sorry yes I was understanding that.

I found some unusual behaviour from the TCP send function though (I could monitor this with a receive node). Every time I sent a string to the switch, it wouldn't see this first character. I could work around this with a dummy character but unfortunately the switch would not let me login even when receiving the correct info from WD. So there must be something within the authentication of the Telnet connection that won't allow WD to login to the switch.

A workaround is to call an external script (for example Visual Basic) from within WD that carried out the config operation in the switch.
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am

Re: Controlling Cisco Switch from WD

Postby Dennis Kuypers » Fri Nov 24, 2017 7:23 pm

Hey,

we have a SG500-52 that we could test with. Can you provide the port number and the scripts that you are using?

Regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Controlling Cisco Switch from WD

Postby djrappa » Sun Nov 26, 2017 1:07 am

Unfortunately I don't have the scripts with me as they are onsite, but I will forward them over later next week when I have access to the machine they are on.

Thanks
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am

Re: Controlling Cisco Switch from WD

Postby djrappa » Tue Dec 12, 2017 2:31 am

So this is the exact .vbs script I'm using to accomplish the task.

If I attempt to recreate in WD as I said the first character is being cut off and regardless of a correct user name and password being entered the switch fails to login so the script can continue...

Code: Select all
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500

cloner.SendKeys"telnet 192.168.1.213"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys"cisco"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"config"
cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"interface ge1/2"
cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"switchport access vlan 7"
cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 500

cloner.SendKeys("{Enter}")
WScript.Sleep 200

cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 200
Cheers
Clint Dulieu
Dulio Design
djrappa
 
Posts: 183
Joined: Wed Jul 01, 2009 10:46 am


Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 6 guests