[SOLVED] Ignore Ports

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

YOU NEED TO REMOVE THE SINGLE QUOTES FROM AROUND THE PORTS TO IGNORE!!

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ddonohue
Cacti User
Posts: 77
Joined: Mon Jul 10, 2006 10:36 am
Contact:

Post by ddonohue »

Sorry, used the wrong picture
Attachments
blah.JPG
blah.JPG (119.53 KiB) Viewed 7736 times
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You will have to show me on-line. I have reviewed the code and can not reproduce without the "I saw it break by myself" factor.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ddonohue
Cacti User
Posts: 77
Joined: Mon Jul 10, 2006 10:36 am
Contact:

Post by ddonohue »

The only place i've seen it broken is in interfaces where there is 3 numbers, ie.

2/0/1
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You should debug by placing some print logic in plugins/mactrack/lib/mactrack_functions.php. The function is something like "get.. dot1d ..ports". Look for the word "Ignore" and then print the ifName for each as it does the compare and see what is going on. It might also be good to print out the Ignore ports array with the function var_dump($ignore_ports);

Then, once you have made the mod, run the scanner in Debug mode.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Grogman
Cacti User
Posts: 54
Joined: Tue Feb 21, 2006 11:45 am
Location: Spain

Post by Grogman »

Hi to everyone,

I had the same problem with cisco devices. It was solved when I introduced the dot1dBasePortIndex instead of the port descriptor. For example, if the port you want to ignore is Fa1/1, you can obtain the interface index in the iftable of your device (oid .1.3.6.1.2.1.2.2.1.2) and the relation between that index and the dot1dBasePortIndex in the dot1dBasePortTable (oid .1.3.6.1.2.1.17.1.4.1.2). In that last table, you have to search the interface index in the results of the snmpwalk, and the dot1dBasePortIndex you have to introduce in the ignore field is the last number of the oid in which you found the interface index. Remember that if you want to gather this information in a cisco device, you'll probably have to do community indexing with the vlan id in which the port you want to ignore is assigned.

Hope this helps you :)


Witness: Is the ignore field supposed to work this way, or is there any particular problem ignoring ports with cisco devices that can be worked around introducing the dot1dBasePortIndex instead of the port numbers?
Who is more foolish? The fool or the fool that
follows it?
jafne
Posts: 6
Joined: Thu Aug 17, 2006 7:59 am

Post by jafne »

I'm using this against a Cisco 3500XL and I'm unable to ignore the ports, too. From reading this thread, I did an snmpwalk against the switch and there is no "ifName" variable. I'd really like to ignore the Gi0/1 port because I've got several Cisco 3500XLs stacked and don't want the info from Switch #2 being reported as part of Switch #1.

If you need screenshots or the results of the snmpwalk, let me know. Any help would be appreciated.

Running cacti 0.8.6i, mactrack 0.0.1b
Last edited by jafne on Thu Nov 16, 2006 9:20 am, edited 1 time in total.
User avatar
Grogman
Cacti User
Posts: 54
Joined: Tue Feb 21, 2006 11:45 am
Location: Spain

Post by Grogman »

Hi Jafne,

You should try something like this:

First of all, issue a snmpwalk of the oid .1.3.6.1.2.1.2.2.1.2 , you should obtain something equivalent to this in your switch:
.....
IF-MIB::ifDescr.447 = STRING: FastEthernet9/1
IF-MIB::ifDescr.448 = STRING: FastEthernet9/2
IF-MIB::ifDescr.449 = STRING: FastEthernet9/3
IF-MIB::ifDescr.450 = STRING: FastEthernet9/4
IF-MIB::ifDescr.451 = STRING: FastEthernet9/5
IF-MIB::ifDescr.452 = STRING: FastEthernet9/6
IF-MIB::ifDescr.453 = STRING: FastEthernet9/7
IF-MIB::ifDescr.454 = STRING: FastEthernet9/8
IF-MIB::ifDescr.455 = STRING: FastEthernet9/9
.....

Supose we want to ignore port FastEthernet9/5, this is index number 451. Now we issue a snmpwalk of oid .1.3.6.1.2.1.17.1.4.1.2 with community indexing (using the vlan of FastEthernet9/5) and we obtain something like this:
.....
SNMPv2-SMI::mib-2.17.1.4.1.2.1026 = INTEGER: 448
SNMPv2-SMI::mib-2.17.1.4.1.2.1027 = INTEGER: 449
SNMPv2-SMI::mib-2.17.1.4.1.2.1028 = INTEGER: 450
SNMPv2-SMI::mib-2.17.1.4.1.2.1029 = INTEGER: 451
SNMPv2-SMI::mib-2.17.1.4.1.2.1030 = INTEGER: 452
SNMPv2-SMI::mib-2.17.1.4.1.2.1031 = INTEGER: 453
SNMPv2-SMI::mib-2.17.1.4.1.2.1032 = INTEGER: 454
SNMPv2-SMI::mib-2.17.1.4.1.2.1033 = INTEGER: 455
....

Now you see that index 451 corresponds to oid mib-2.17.1.4.1.2.1029, so 1029 should be your number. Introducing 1029 in the ignore ports field should work...

If you need more help, please send the snmpwalk outputs of the above oid's so we can take a look :wink:
Who is more foolish? The fool or the fool that
follows it?
jafne
Posts: 6
Joined: Thu Aug 17, 2006 7:59 am

Post by jafne »

Solved! Thank you very much!
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I am currently working on a new release. I will add this enhancement to the list. Please follow my sticky in the mactrack section of the forum for more details.

Your feedback would be highly desirable.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest