Newbie needs help tpo color interface on map accoprding to STP status

Started by Gaston, June 23, 2017, 04:10:47 PM

Previous topic - Next topic

Gaston


Hi,

I am quite new to netxms, using it for a while now, but without any advanced configuration.

I use NetXMS to monitor my home network with 9 managed switches in a spanning tree mesh. My goal is to display this "backbone" on a map with the interface status being colored according to the STP status (forwarding, blocking,...)

What I managed to do so far:


  • Auto discover the network
  • Create a map showing only the backbone components (switches and routers)
  • Device links are auto-generated on the map
  • Define device level SNMP DCI

Q1:

The first issue I have is that some switches are linked by multiple connections between them, but only one connection is generated on the map. I could now create a second link and specify the other connector names, but the second connection is right on the first connection (one oiver the other) and I found now way to move the conenctions to be shown parralel, instead of on top of each other.

Q2:

My understanding of DCI is that it is managed on device level so I need to add entries for the dot1dStpPortState for the required ports. I am unsure if it is possible to read a complete table at once, i.e. if I can enter one single DCI parameter with the OID of the dot1dStpPortState table, or do I have to enter sperate DCI entries for each interface. The first option would be faster for me and for the switch as it could walk the data instead of requesting each separately.

I was able to give the table OID to the DCI and it also confirmed type "Table", but I am not sure if this makes the child data (i.e. per interface state) accessible.

Q4:

And of course the most important question, how do I use the dot1dStpPortState to change th einterface color on the map, like green for forwarding , red for broken, yellow for learning, orange for blocking or listening, and some other color for disabled.

P.S.: Yes, I did use the forum search but did not see any related threads.




Tursiops

Hi,

Regarding Q2:
You can use an SNMP Table DCI or Instance Discovery.
For an SNMP table, create a "table" DCI (as opposed to a new "parameter"), select SNMP as Origin and enter the table's index OID as Parameter.
In your case, I think that's .1.3.6.1.2.1.17.2.15.1.1.
Then add whatever columns you want to collect from that table under the Columns section, e.g. .1.3.6.1.2.1.17.2.15.1.3 for State. If required, go through the MIB Explorer tool to work out what's available.
I haven't tried to reference a table DCI in another script, so I can't tell how well that will work. I know alerting can be an issue and graphs are not as easily accessible.
You may also want to filter the number of interfaces down to only those that have STP enabled.
I haven't worked with this particular table and am not sure what values to expect.

If you intend to use the DCIs for alerting or to reference in other scripts, you may be better off using Instance Discovery.
Just create a new DCI, use SNMP as Origin, enter the OID you want to query, e.g. .1.3.6.1.2.1.17.2.15.1.3.{instance} for State, as Parameter and under Instance Discovery select SNMP Walk - OIDs with Base SNMP OID set to .1.3.6.1.2.1.17.2.15.1.1.
Again, you may want to filter for interfaces with STP disable or admin status down or only interfaces with an expected state of up.
You may also want to add some logic to that filtering script to grab the actual interface name and return that for the {instance-name} for your DCI Description. I am pretty sure there are several posts on the forum with examples for that.

Q1 is something I have encountered myself and do not have a solution for.

For Q4, I haven't done this and I am not sure if it would work with Table or Instance Discovery DCIs. You can manually change the properties of a link to set the colour based on an object status. That object can't be a DCI though. However, it could be a Condition, so you could setup a Condition to have a status based on your DCI status. But as I said, I don't think that'll work for a table. And for an Instance Discovery, the link between DCI and Condition will be gone if that instance is ever "rediscovered", which at present is not too uncommon. There's an open feature request to keep instances "alive" for a while, even after they can no longer be found (e.g. at present a temporary glitch or connectivity issue could wipe all your instances and historic data).

Cheers

Gaston


Thank you Tursiops for your inputs. These have given me a few clues to follow and a few new netxms concepts (for me) for me to look into.

Regarding Q1, I think I found a workaround by adding the interfaces to the map and link them.

Concerning the link coloring, is it possible to color the two connectors of a link separately ? Coloring the link line would not be helpful in case of STP as both ends may be in a different state. An alternative would be to use the interface status as I have them on the map now. But I don't know how to create custom rules for an interface status.

Tursiops

You can add a DCI Image to your map, e.g. next to your interface.
That image can then be based on the status of your DCI. You could show a green icon as default value and a red one if the status if the status is something else (the rules here are quite flexible). That is not quite the same as assigning a status to the interface itself, but it might be sufficient for what you are trying to achieve?

Gaston


Yes, realized on Saturday that this could possibly be best achieved using DCI images. I have created a set of 7 icons (6 states + default) and created some DCI images to display the states near the interface icon. But thanks for the pointer anyway.

One point I did not yet find a solution for are the now obsolete links between the switches on the map. Is there a way to hide individual links, or to prevent deleted links top be recreated automatically ?

I know tha all links can be hidden, but I want the linke sbetween the interfaces to stay on the map.

Gaston


Forgot to mention that iot is a pitty that DCI images cannot be copy/pasted, thus I have to create the rules for each single interface :(

Tursiops

I agree on the DCI Image part. I've had to create a number of them manually as well, then re-create the rules. It can be quite tedious.

As you already created manual, separate links between interfaces which you manually added to the map together with manual DCI images, you are probably at a stage where creating a custom map manually may make more sense.
In that scenario, no automated links between devices will be created - you have to add every item yourself.

Gaston


Youi are right about the custom map of course. I created this map some time ago, and believed it to be a custom map. I did not find any way to identiofy the type of map once it is created. By doig some testing after your post I found that my map is probably a layer 2 topology map by comparing thge "Map options" page.

Is there a way to change this map into a custom map ? Hoped that cloning could do that, but seems it can't. I have alreadyx created quite some DCI images and I am not in the mood to recreate them all, as I also still have to crete some others. I do have a total of 36 ports participating in the spanning tree.


Tursiops

I don't think there's a way to do this in the GUI.

I had a quick look to see if it would be enough to change the "map_type" in the "network_maps" table in the database to "0" for the map in question (based on our table it appears that 0 = Custom, 1 = Layer 2, 2 = Layer 3) and to remove all seed nodes from it - the result was that the map I was testing with became extremely slow to work with (and ended up with over 3000 links, rather than the 30 it had before - most likely the reason for the speed issue). Changing flags to match another custom map did not help and I ended up wiping the map.
There may of course be a safe way to do this if steps are taken in the right order, but I am pretty sure it's not exactly "supported" and may trigger all kinds of unwanted side effects.

Gaston


Thanks for the testing. You're right I would not be comfortable doing so, even if we would identify the steps as there is still much work to be done which could be a risk at a later time then.

I did it another way, in generating the correct mood to recreate the map ;D I did so by regenarting my status icons (37 in total now, including different arrow directions for forwarding and blocking and different colors for expected and unexpected states), so that forwarding and blockiing icons now exist in green and yellow to be used depending on the expected state of a port in normal spanning tree state.

I have created a full STP DCI template which I could quickly apply to all switches and then just delete the unused ones. I know that with DCI images I could be using SNMP tables as well but with parameters each icon correctly shows its switch and port when hovering over it.

It would be great if NetXMS would have templates for DCI images and containers as well.

Gaston


OK, 6 switches done. Quite boring to define 30 DCI images (so far) without templates.

Also, I found no way to add a map legend for the different state icons because decoration images can have no text. The only way I found so far is to create a dummy condition with the icon as map appearence and the key intop the name field. Setting propagation status to always "Normal" and then place it onto the map and unmange it (as the grey "X" is less disturbing then the blue "?")

The two last switches are Netgear switches which have no standard MIOB for STP, I will have to retrieve the private one.

I am quite happy with the result.

Thanks again for having pointed me into the right direction.