Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way in Visio to telnet or http to an IP addr of object?

Status
Not open for further replies.

joenok

MIS
Feb 27, 2002
49
US
Just curious to see if anyone has setup a way that you can telnet or http into an object. I thought it would be pretty handy to be able to right click and telnet into a switch or router right from Visio. Just an Idea, I didn't know if there was something built in or a third party?
 
There is a way built in. First go to VB editor (Alt-F11) and generate a Macro by pasting this into the code window for ThisDocument
Code:
Sub macro1()
x = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler [URL unfurl="true"]http://www.essexsteam.co.uk/",[/URL] vbNormalFocus)
End Sub

Close VB editor and go back to the Visio doc. Then right-click a shape and go to Format|Behaviour and select the Double-Click Tab. Select the Run Macro option and scroll down to select ThisDocument.Macro1 then click OK

That's it - done! Double click on the shape chosen and you will get a new browser instance pointing to my website. (You can of course choose your own target [smile])

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
How would you pull a custom property to be the destination address? For instance, my shape has a custom proptery of prop.loopback. When I double click on a particular object, it would telnet me to that loopback address and so on and so forth with other objects.
 
I was able to do a hyperlink in Visio and it gives you 2 options. local file or address, you can either put in the filename of the session you want (if your telnet client supports it) or point it to either or telnet://myswitch. It seems to work well, now I just have to find a good telnet program that lets you do command line sessions. thanks for all the feedback!

Joe
 
Check out SecureCRT from Vandyke. I have been playing with John's code and can have it open either telnet or ssh, by switching the http in the above example to either telnet:// or ssh:// (SSH:// requires a reg hack though, but is not very difficult.) My only problem is just getting the custom property as the IP address when I double click on it. All my objects are being fed in from a database, and I would rather not have to go and touch every object to set up the telnet or ssh.
 
I have been contacting SecureCRT from Vandyke and haven't been able to find out from them on how to point to the .ini file from a commandline so you can use hyperlink with Visio. I kinda wish they'd use a different session name instead of .ini I could associate SecureCRT to .ini files but then whenever I want to edit an .ini with notepad, my securecrt will come up. I don't know if theres a way to script it or do it from a batch file.
 
Hmm. What I did is I have a WAN inventory sheet in excel, that amongst other things includes ip address, location, etc. I then created a custom shape in Visio and then imported all the information from Excel to Visio. This way, I don't have to maintain an inventory of connections in SecureCRT or any other apps. I just add, change, or remove the information from Excel and re-import to get the updates.
 
Is that hard to do? I can see where I can add a new entry (define) under custom. What do you do after that to point it to Excel? Is there a white paper on how to do this. I'm not too smart.

Joe
 
I figured it out through trial and error and finding information on various websites. Try these steps, I'm using Visio 2003:

In Visio:
1. Create a Shape.
2. Add to the shape Custom Properties
[Hostname, IP Address, City]
3. Edit the custom properties through the shapesheet
prop.Hostname
prop.IPAddress
prop.LocCity
4. Save the object as a stencil.

In Excel:
5. On the first row of the sheet enter the following labels:
Cell A1 Hostname
B1 IP Address
C1 LocCity
6. Enter a few rows of information in the corresponding columns.
7. Save the Excel Spreadsheet.

In Visio:
8. Click Tools -> Add-ons -> Run Add-on.
9. Scroll until you find Import Data
10. The only option will be "Into Shapes that I manually Place", Click next. (Note: In the future, you only need to use this option as well when adding more shapes or updating information into shapes that already exist.)
11. Type is Excel, and the location of the Excel Spreadsheet you just created.
12. Select the Worksheet, in this case should be be Sheet 1. Include all rows and columns for now. Click Next.
13. Select the stencil you just created. Click Next.
14. Leave lable and color alone for you now and Click Next.
15. Unique ID is important, select something that is going to be unique to every object, like a hostname or ip address. When you import updates from the future, this is how it knows not to create a new object and to update the information already present on the drawing.
16. When you click next it will import all the information, creating new object for every row in the excel sheet.

That's it pretty much in a nut shell. There are other things you can do like pulling information from the Custom Properties into Text on the object so you don't have to do all the labeling and what not. Once I figure out the Macro, you edit the stencil to execute the macro on double click and should be able to telnet directly to the device. Just need to figure out how to get the custom property into the macro at this point...

 
Finally got telnet to work from a shape. Very simple in the end. In the shape sheet, insert an Actions section.

Create an action and in the Action area put the following code, where &Prop.Loopback is the Custom property that contains the IP address or Hostname of the device:
=HYPERLINK("telnet://"&Prop.Loopback)

Under menu, put Telnet or whatever you would like to call it. Exit out, right click the object, and voila, telnet access to your device. If you need to telnet to an odd port other than 23, try this:

=HYPERLINK("telnet://"&Prop.Loopback&":3010")

Replace 3010 with whatever port number you would like to go to.
 
Hi PerryJL,

Can you explain how you enabled ssh:// to work ?
Telnet is indeed possible that way in your example, but hopefully you could provide some more info on the "reg hack" you talk about, to be able to do the same with ssh as you did with telnet.

Hope you can help!!

Rgrds,
Visio attic
 
I'm trying to setup a 'dynamic hyperlink' such that I can define a parameter once and then use it throughout the rest of the Visio document (i.e. rest of the shapes and hyperlinks).

Here's what I've done:

1) Created a custom property in the shape that I will link *from* called FileName
2) Updated the Address field in the same shape (in step 1) to use 'FileName' (no quotes).
3) Set the FileName value via:
a) right click on the shape
b) select 'properties'
c) set the value of 'FileName' to the document path/name... also I use relative pathing.

Nevertheless, it doesn't work. It's looking for a file called, literally, 'FileName'. Is there a way I to reference it correctly in the custom
property setup? For example, something like:

property.FileName

or

&FileName

or

&Property.FileName

(By the way, I've tried all of these ways and it doesn't work).

But there must be a way to tell it that I'm referring to the custom property name!

Please help.

Thanks.

NJDevil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top