Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 19, 2019 1:41 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Weathermap for Cisco N5K
PostPosted: Tue Oct 24, 2017 10:49 am 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Hello everyone,

I'm going to set up a weathermap with all our cisco switches (interfaces status only)
For simple switches (I mean 1U switches manageable) it seems ok (not tested yet but all I read from people on this forum is pretty clear).

My question is : how can I deal with complex switches like Cisco N5K ?

If I "snmpwalk" one of these, my indexes are like :
Code:
IF-MIB::ifIndex.530973504 = INTEGER: 530973504
IF-MIB::ifIndex.530973568 = INTEGER: 530973568
IF-MIB::ifIndex.530973632 = INTEGER: 530973632
IF-MIB::ifIndex.531169280 = INTEGER: 531169280
IF-MIB::ifIndex.531169344 = INTEGER: 531169344
IF-MIB::ifIndex.531169408 = INTEGER: 531169408
IF-MIB::ifIndex.531169472 = INTEGER: 531169472


And of course, some of them are part of one N2K (FEX 167) and others are part of an other N2K (FEX 170)
Code:
IF-MIB::ifDescr.530973504 = STRING: Ethernet167/1/14
IF-MIB::ifDescr.530973568 = STRING: Ethernet167/1/15
IF-MIB::ifDescr.530973632 = STRING: Ethernet167/1/16
IF-MIB::ifDescr.531169280 = STRING: Ethernet170/1/1
IF-MIB::ifDescr.531169344 = STRING: Ethernet170/1/2
IF-MIB::ifDescr.531169408 = STRING: Ethernet170/1/3
IF-MIB::ifDescr.531169472 = STRING: Ethernet170/1/4


How can I create such a switch node with my 2 FEX (in fact there are more than 2 FEX per N5K - it's just for the example) ?
Anyone tried it ?

Thanks for your help.


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Tue Oct 24, 2017 11:44 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
I don't think this a weathermap question.

But... have you tried it? This is how all chassis or stack based Cisco switches have always worked - With chassis/module/port names. Cacti doesn't care about the indexes being sequential. e.g. on a 3750 stack the ports go from 10101 to 10124 then 10601 to 10624 on the second unit, which is effectively what a FEX would look like. Same for a 6509 with multiple cards.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Tue Oct 24, 2017 1:22 pm 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Unfortunately, not tested yet.

I'm not afraid Cacti will handle this easily

My question is how will I be able to generate such chassis in a weathermap...I mean I have several N5K with several FEX each - some have 16 ports, some have 48, how can I script such thing ?
If I need to create port node and swich node by hand it will take me very long (about 500 ports per N5K). Or maybe I didn't understand something (it's possible too ^^).

Other thing, since my only need is having port status I was thinking about avoiding cacti pull (no graph needed) like pulling manually and storing result in mysql table.
But as far as I know, Weathermap only works with cacti graphs or direct SNMP OID.

So what is the best in my case ?


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Tue Oct 24, 2017 1:34 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
Learn a scripting language. Or excel. You can make excel generate Weathermap config.

E.g: you know the ports are in a grid, and you want 2 rows of 24 ports each. You can calculate the position of each node (port) on the map, relative to the first port:

Code:
NODE sw1_p1
   POSITION 100 100
   ICON image/switch_port.png

NODE sw1_p2
   POSITION sw_p1 0 30

NODE sw1_p3
   POSITION sw_p1 30 0

NODE sw1_p4
   POSITION sw_p1 30 30


Now you have a grid of nodes which will all move when you move sw1_p1. Excel or any scripting language will make this type of node generation easy.

In the random-bits folder of the weathermap directory, there is a script called cacti-integrate.php. It takes a map config file, and tries to find matching cacti datasources based on the interface names/aliases. It also fills in all the overlibgraph entries, if it can.

So you also need to define some SET variables for each node, so cacti-integrate can work:

Code:
NODE sw1_p1
   SET hostname sw1.mycompany.net

(you can also set cacti_id to the actual database ID for the device in cacti. If you use the hostname, it must match the one in the cacti database)

Then for each link, you can specify the name of at least one of the interfaces it connects to:
Code:
LINK l1
   NODES sw1_p1 sw3_p4
   SET out_interface Gi44/0/2


With that info, cacti-integrate can find the right datasource, and will fill in the TARGET, INFOURL, OVERLIBGRAPH ans BANDWIDTH for you.

If you make good use of TEMPLATE, you can save a lot of repetition for formatting the nodes, too.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Tue Oct 24, 2017 2:02 pm 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Maybe I need to look at the cacti-integrate.php script you're talking about.
Thank you for the relative port position (I saw that we could set position of all ports node in a switch node but I didn't know we could set a port node position based on an other one)

I know a little bit about perl (made some devs for my customers) and bash scripting so it's not a dev issue.

I think I'm just confused about how to generate it.
For example FEX 110 has 16 ports, FEX 120 has 48 ports, FEX 130 has 24 ports.
The thing is I want to generate a weathermap for my N5K without knowing how many FEX and how many port per FEX.

When adding my N5K to cacti, it will discover all interfaces.
But will it able to order it by FEX (and if yes - based on what ?).
With a script to generate my weathermap config file how will I be able to generate the good number of interfaces for each FEX of my N5K. (maybe cacti-integraphe.php can help me since it will match cacti datasources based on interfaces names)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Wed Oct 25, 2017 4:01 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
No, cacti-integrate will not help you add the nodes. It only looks for data for existing nodes.

I don't really see the problem with constructing this in groups of ports (main switch, then fex 1 then fex 2). Unless you forgot to mention that you have 15000 of these units.

I think you are assuming that Cacti and Weathermap are both much smarter than they are. Cacti will just read all the interfaces and add them - SNMP doesn't care what metal box they are in. Weathermap just turns numbers into colours - it doesn't care what the numbers mean.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Wed Oct 25, 2017 8:45 am 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
It was late yesterday for me, sorry if I said weird things...

I read cacti-integrate.php to understand what it does so I'm ok with it.

What is not easy for me now is that I'm talking about Cacti & Weathermap as memories (I used them couple years ago - as you can see I don't post often but I'm registered since...2006 ^^).
I don't have a server right now but I'm going to install it in few days so I try to imagine how I will use it...so you can understand it's not easy for me :)

So if I use Cacti, the Cisco template will generate all relevant informations about me devices' ports (as far as I remember).
When I'm going to create my weathermap config file, I will write a perl script to generate all ports for my Cisco N5K (6 devices with 500 ports each)
Let's say first card has 2 ports, second has 16 ports, third has 48 ports, fourth as 16 ports.

So I want my script to create an image with 4 cards (or FEX). The first one will have only 2 ports (with color red/green), the second will have 16...
I guess I need to use an image with 48 ports for all cards an only fill 2 ports on first, 16 on second....right ?

How my script will know that first card has two ports ? What is the information in Cacti that help me to make the difference between my cards (the Interface Name / Descr ? How will my script gather this information).

Other possibility - in my case no graph is needed (only UP/DOWN ports), so I was thinking about not using Cacti.
I mean, I can gather all ports states and description in a simple MySQL table and then generate my weathermap config file (in this case I know how to easily parse interface name so I know how many card I have). Don't you think it would be better ?

And...I don't agree with you - Cacti and Wearthermap are so smart !!! So far I didn't find any competitor which could stand in front of weathermap...


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Wed Oct 25, 2017 11:53 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
I would use an image for a *port*, and an empty rectangle for the chassis. That way you can avoid this whole issue :-)

You just have port-up.png, port-down.png, port-error.png etc.

To automatically find the number of ports on each card, you might find something in OLD-CISCO-CHASSIS-MIB to help, perhaps? There are a few different cisco mibs for hardware inventory.

If you want to go the non-Cacti route, I'd try the 'tabfile' datasource in Weathermap, which is just a tab-separated text file with 3 columns: node/link name, 'in' value, 'out' value. As soon as the next version is out, it will support SNMPv2c and v3 polling directly (it only does v1 currently). You'll be on your own with mapping out those ifIndex numbers again then, though.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Thu Oct 26, 2017 1:29 am 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Quote:
I would use an image for a *port*, and an empty rectangle for the chassis

That's what I meant when I said "I guess I need to use an image with 48 ports for all cards an only fill 2 ports on first, 16 on second....right ?".

But if I use a MySQL to store all my devices' informations, my script will easily find how many ports there are on each fex so it can choose the right switch image :)

I don't like using MIBs, the idea is to create something as generic as possible to work with several customers (but I'm OK with the idea)

What is the 'tabfile' you're talking about ? (I didn't see any topic on it)

N.B : Thank you for taking the time to answer my (sometimes stupid) questions - I really appreciate (and sorry for my english)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Thu Oct 26, 2017 4:06 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
Yes, tabfile. It's in the manual:

http://network-weathermap.com/manual/0. ... .html#tabs

I don't really understand your proposal for the devices though - how does your data get into mysql if not from SNMP?

And then you would need to write a data source plugin for weathermap to read the mysql database.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Thu Oct 26, 2017 4:22 am 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
My idea is a script gathering all informations I need through SNMP.
Everything is stored in my table.
Then an other script read the table to generate my config file (which will contain no datasource but only images - my ports NODES will be ICON put on my switch NODES - static images) and weathermap create the final image.

Am I wrong ?

Thank you for the tabfile link !


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Thu Oct 26, 2017 4:26 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
OK, that makes sense. Before, it seemed like you didn't want to use SNMP :-)

Yes, that would work. I would write it as one script and skip the database, personally, but it doesn't make much difference.

Good luck! :-)

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Thu Oct 26, 2017 1:02 pm 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Yes ! I'm not so foolish :wink:

Thank you for your time (and - but you already know it - for your great job that helps us all !).


Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Wed Jul 25, 2018 6:59 am 
Offline

Joined: Wed Nov 15, 2006 5:14 am
Posts: 18
Hello,

It's been a while but thanks to your help I finally made it.
Now all my datacenter is under control.

I attach a Cisco Nexus we use for example.

Thanks again !


Attachments:
Cisco Nexus.png
Cisco Nexus.png [ 238.88 KiB | Viewed 716 times ]
Top
 Profile  
 
 Post subject: Re: Weathermap for Cisco N5K
PostPosted: Tue Apr 02, 2019 9:59 pm 
Offline
Cacti User
User avatar

Joined: Fri Jul 10, 2009 1:38 pm
Posts: 281
Location: Toronto, Canada
would you care sharing your configuration...... or at least snippets of it.... I'm starting to do the same, but i have some hurdles.

Thanks

Z


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group