Author Topic: visio diagram to automatically ping and display device as red or green.  (Read 46809 times)

0 Members and 1 Guest are viewing this topic.

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: visio diagram to automatically ping and display device as red or green.
« Reply #15 on: February 02, 2011, 12:16:42 PM »
It's a popular topic. You might check these out (especially the included demo)

http://visguy.com/vgforum/index.php?topic=1241.msg5435#msg5435

al

cliff50

  • Full Member
  • ***
  • Posts: 213
Re: visio diagram to automatically ping and display device as red or green.
« Reply #16 on: March 22, 2011, 01:07:18 AM »
Al ,
it is an interesting concept,  to create a visio manifestation that apsires to display the on line status of the actual network.

From my experience, manufacturers of Network equipment often sell some sort of alarm monitoring system, albeit the GUI of which is not very versatile and has limited customisation.

I think telnet pinging to data nodes and interrogating the response or lack thereof may have open some avenue to determining node status, and as said, may also create its own set of problems flooding large networks with unneccesary traffic ,  i guess it all depends on the rate of change of what you are trying to track.

Again in my experience, "as built" vs "is built" maybe best served by a strict enterprise change control process, the problem there being once a "phantom" change is discovered the process of determining who,  and when a change occured becomes more relevant, then where or what change occurred.

our approach, was to create a customised data capture script which we run via the nodes local craft terminal interface, approximately every 3-4 months. Changes are detected and advised to the Visio doc maintainer who is empowered to update and vaildate each change.

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: visio diagram to automatically ping and display device as red or green.
« Reply #17 on: March 22, 2011, 07:35:27 AM »
The observation of "problems flooding large networks with unneccesary traffic" is very appropriate. At least one early study that  I saw several years ago observed almost 25% of the traffic on the Internet at that time was 'network management'. To make matters worse the echo command by design is supposed to be discarded when the network is in stress, thus TCPIP throws away the messenger that tells it there is a problem. This drives the discussion towards "alarming" vs "heart beat".
Telnet 'pinging' vs Echo 'pinging' should only be used under exceptional circumstances.
In any case using Visio as the visualization mechanism is an interesting exercise but is not intended to replace machaisms such as CiscoWorks or tools such as Openview and Netview. Unfortunately as a network consultant I was never guaranteed that any client would have what I would consider a catalog of tools to provide a minimally documented network, much less hope for materials that could be used to provide their management with a defendable appraisal of their current status. The defense was a toolkit that was portable and customizable for what I was being contracted for. Visio to the rescue..
My personal favorite experience was with the client where change/configuration management was a documented condition of employment. If they caught you making an undocumented/unauthorized change you were open to separation from the company.
Al

vijay4b7

  • Newbie
  • *
  • Posts: 1
Here is a simple "red-green" Visio drawing (plus some VBA code)

It has three boxes with IP-addresses (see picture)
You can add more boxes or change the IPs, i.e. the text in the boxes; keep in mind, only 4-digit IP addresses are supported (no name resolution).

VBA code "in background" colors each box red, if PING to it's IP fails or green if it succeeds.
The refresh timer is set for 30 seconds.

Seems to work  ;)

N.B. I don't think that VBA is a good idea for this kind of "diagrams".

Hi Nikolay,

I am new to this forum and Visio too.
Just started learning drawing a simple network topology diagrams.

Basically, I am developer on C language. We write protocols for switches and routers.

Coming to the point. I have a Lab with 20 devices.
I have made a small topology for our testing. So, started drawing a diagram for the same.
Here came the requirement after setting up the toplogy.

Requirement:
Visio diagram to automatically ping and display device as red or green.

Exactly this thread and found your example. Which is working great, but most of the times it is sluggish.
I have copy pasted more boxes to ping other devices too.

I would like to know, how you have created the code? Need some inputs on that.
I want to learn.

I want use switches (Senticls) and write the same piece of code, which should ping my devices when ever required.

Also, I would like to know, whether this is possible only through Visio?
I mean let's say, I done the work and save the file in some other format? do I still get the requirement?

Please mail me the steps to follow.
vijayraju11@gmail.com

 




dave748

  • Newbie
  • *
  • Posts: 2
Re: visio diagram to automatically ping and display device as red or green.
« Reply #19 on: March 04, 2016, 05:12:16 AM »
Hi,

I know this topic hasn't been posted in for a long time but I have a Visio document I use to look at the various sites in my network.  I a few macro's running that allow me to telnet to a device using double click and some mouse overs that give me extra info and a few other things.  On the front page is a list of all the sites that I double click on to go to the page of that site.  What I'd like is to put a small circle next to each site name that stays green when pinging an ip address at that site and turns red when it can't be reached.

I've tried to adjust the ping green and red square Visio code posted a while ago in this forum but I want it to only work on specific shapes in the document not every shape as per the For Every shp, For Loop in the code.  I'm only going to be pinging about 10 devices and I can't install any kind of external software so it has to be done in visio in VB code.

I beleve the part of the code I need to adjust to point to a single shape is the below:

Public Sub UpdatePingState()
           Dim shp As Shape
           For Each shp In ThisDocument.Pages(1).Shapes
           IP = "**.**.**.**"
           etc.
           etc.

I've tried various things to make it point to one particular shape but not been able to do it, can anyone help?

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: visio diagram to automatically ping and display device as red or green.
« Reply #20 on: March 04, 2016, 06:14:05 AM »
Hi,

I would be tempted to build this into your master shape.  For example, if you have a Group shape and add a circle shape to it, the group shape would have Shape Data such as Prop.State and this is the cell your code would write to.  Your sub-shape (the circle) would reference the Shape Data in the group and change it's colour accordingly.  This way you can separate the visual change from the state data.  You could then start your ping code by setting the Shape Data:

Code
shp.CellsU("Prop.State").FormulaU = "Starting"

make you ping call, wait for the result and then set the Shape Data cell once more with the result:

Code
shp.CellsU("Prop.State").FormulaU = "Success"

Once you've got a master you can use the CreateSelection method on Page to get a selection object based on that master.

If you can't do this by master then you'll need to determine some other method of how you uniquely indentify your target shapes - by a particular Shape Data / User cell, maybe with a particular value, by position on the page etc.

Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

dave748

  • Newbie
  • *
  • Posts: 2
Re: visio diagram to automatically ping and display device as red or green.
« Reply #21 on: March 04, 2016, 09:03:44 AM »
Hi,

I would be tempted to build this into your master shape.  For example, if you have a Group shape and add a circle shape to it, the group shape would have Shape Data such as Prop.State and this is the cell your code would write to.  Your sub-shape (the circle) would reference the Shape Data in the group and change it's colour accordingly.  This way you can separate the visual change from the state data.  You could then start your ping code by setting the Shape Data:

Code
shp.CellsU("Prop.State").FormulaU = "Starting"

make you ping call, wait for the result and then set the Shape Data cell once more with the result:

Code
shp.CellsU("Prop.State").FormulaU = "Success"

Once you've got a master you can use the CreateSelection method on Page to get a selection object based on that master.

If you can't do this by master then you'll need to determine some other method of how you uniquely indentify your target shapes - by a particular Shape Data / User cell, maybe with a particular value, by position on the page etc.

Hope that helps.

Best regards

John


Thanks John,

Would it be possible to reply as if your talking to someone who is not a VB scripter or visio expert but who can, given enough time, manipulate very simple code other people have written to do sort of what I want it to do.  This one I'm struggling with though.

I don't want to change the way it works, I just want to apply the code to a specific shape(s) rather than every shape on the page, there must be an easy way to do that.
« Last Edit: March 04, 2016, 09:24:34 AM by dave748 »

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: visio diagram to automatically ping and display device as red or green.
« Reply #22 on: March 04, 2016, 11:34:39 AM »
Sure - on what basis do you want to choose which shapes to process?  Normally this would be based on a particular master shape.  Are the shapes you want to target based on a master?

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: visio diagram to automatically ping and display device as red or green.
« Reply #23 on: March 04, 2016, 11:47:36 AM »
assuming that this is v20xx pro and can support datagraphics, I would tie the indicator to a status property that is only available on the shapes with an ipaddress that is 'pingable' and has been tested.
That resolves the issue of not having the datagraphics tied to every shape.
al

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: visio diagram to automatically ping and display device as red or green.
« Reply #24 on: March 04, 2016, 03:36:30 PM »
Good point Al.  I have a ShapeSheet hammer so all I see are new masters :)
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: visio diagram to automatically ping and display device as red or green.
« Reply #25 on: March 05, 2016, 09:24:20 AM »
John,
One of the challenges I had to face was the client wanting to include 'future' devices in the drawings, which did not yet have a valid IP address assigned. What I ended up doing was assigning an invalid address to the device to allow the code to step past the attempted pinging. I used the address of "911" for the key to ignore the device, and then would flag the device status as questionable.
hth,
al

hrvoje144

  • Newbie
  • *
  • Posts: 1
Re: visio diagram to automatically ping and display device as red or green.
« Reply #26 on: August 06, 2020, 03:29:01 AM »
Is there this code for win64 i am newbie in VBA?

Surrogate

  • Hero Member
  • *****
  • Posts: 1015
    • ShapeSheet™ Knowledge Base
Re: visio diagram to automatically ping and display device as red or green.
« Reply #27 on: August 06, 2020, 03:48:18 AM »
Is there this code for win64 i am newbie in VBA?
Try add PtrSafe keyword, like
Code
Private Declare PtrSafe Function SetTimer

Compatibility Between the 32-bit and 64-bit Versions of Office 2010
« Last Edit: August 06, 2020, 04:04:40 AM by Surrogate »