[TODO] MakTrack and option "Port Security" on Dlin

Support questions about the MAC Track plugin

Moderators: Moderators, Developers

Author
Message
MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

[TODO] MakTrack and option "Port Security" on Dlin

#1 Post by MaLblsH » Thu Dec 03, 2009 8:01 am

Hello!
We are using software CACTI and plugin MacTrack on it. By this software we are getting statistics from switches Dlink (35xx and 30xx series). One month ago we saw that we haven`t got the statistics from switches. We remember that in those time we started to use options "Port Security" in mode "Delete On Timeout". As the result, we have statistics from those ports where the mode is "Learned=Dynamic" (Port Security is off) and we haven`t from those ports where port status is "Learned=DeleteOnTimeout".
We use library mactrack_dlink_c1.php from forum http://forums.cacti.net/download.php?id=8868
In those library we found the block SNMP. We decided to compare two switches: switch from which we have statistic and switch from which we haven`t:

Code: Select all

# snmpwalk -v2c -c community SWITCH_IP 1.3.6.1.2.1.17.7.1.2.2.1.3

SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.9.0.20.209.59.25.17 = INTEGER: 3
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.9.0.20.209.59.116.146 = INTEGER: 3
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.9.0.20.209.82.211.36 = INTEGER: 3
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.9.0.23.49.200.2.35 = INTEGER: 3
and switch from which we haven`t statistics:

Code: Select all

# snmpwalk -v2c -c community SWITCH_IP2 1.3.6.1.2.1.17.7.1.2.2.1.3

SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.291.0.19.212.142.143.116 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.291.0.22.234.123.75.168 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.291.0.28.240.33.34.238 = INTEGER: 3
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.291.0.30.193.76.150.179 = INTEGER: 1
As we see there is no any difference in data structure. We checked another snmp-requests from this library - the structure is the same.
Could anybody help us?
Thank you.
Last edited by MaLblsH on Thu Dec 03, 2009 9:36 am, edited 2 times in total.

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

#2 Post by TheWitness » Thu Dec 03, 2009 8:34 am

You need to more clearly define what is missing and what you are requesting. Thanks.

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#3 Post by MaLblsH » Thu Dec 03, 2009 8:53 am

We want to get this information from switch:
port_name;
port_number;
mac_address;
vlan_name;
vlan_id;
There are OID`s from mactrack_dlink_c1.php:

Code: Select all

.1.3.6.1.2.1.2.2.1.1
.1.3.6.1.2.1.2.2.1.3
.1.3.6.1.2.1.31.1.1.1.1
.1.3.6.1.2.1.2.2.1.8
.1.3.6.1.2.1.17.1.4.1.2
1.3.6.1.2.1.17.7.1.2.2.1.3
.1.3.6.1.2.1.17.7.1.2.2.1.2
.1.3.6.1.2.1.31.1.1.1.18
.1.3.6.1.2.1.17.7.1.2.2.1.2

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

#4 Post by TheWitness » Thu Dec 03, 2009 9:00 am

I see, and currently what is the DLink collector not providing, and what is the difference between the two switches?

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#5 Post by MaLblsH » Thu Dec 03, 2009 9:11 am

Hmmm...
The difference is that on the 1 switch there is option "Port Security" ON and on another one - OFF

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

#6 Post by TheWitness » Thu Dec 03, 2009 10:03 am

Ok, run the scanner in debug mode from either switch and post the output in quotes.

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#7 Post by MaLblsH » Fri Dec 04, 2009 1:40 am

Debug mode for the good switch:

Code: Select all

# php mactrack_scanner.php -id=127 -d
DEBUG: HOST: SWITCH_IP is alive, processing has begun.
DEBUG: Scanning function is 'get_dlink_l2_switch_ports'
DEBUG: ifIndexes data collection complete
DEBUG: ifTypes data collection complete.
DEBUG: ifNames data collection complete.
DEBUG: ipAddrTable scanning for link ports data collection complete.
DEBUG: ifInterfaces assembly complete.
INFO: HOST: SWITCH_IP, TYPE: DES-3526 Fast-Ethernet Switch, TOTAL PORTS: 0, OPER PORTS: 0
DEBUG: No user ports on this network.
Debug mode for the bad switch:

Code: Select all

# php mactrack_scanner.php -id=177 -d
DEBUG: HOST: SWITCH_IP2 is alive, processing has begun.
DEBUG: Scanning function is 'get_dlink_l2_switch_ports'
DEBUG: ifIndexes data collection complete
DEBUG: ifTypes data collection complete.
DEBUG: ifNames data collection complete.
DEBUG: ipAddrTable scanning for link ports data collection complete.
DEBUG: ifInterfaces assembly complete.
INFO: HOST: SWITCH_IP2, TYPE: DES-3526 Fast-Ethernet Switch, TOTAL PORTS: 0, OPER PORTS: 0
DEBUG: No user ports on this network.
It is very strange but the scanner didn`t see the active ports on the both switches. When we started mactrack automatically - it see.

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

#8 Post by TheWitness » Fri Dec 04, 2009 5:50 pm

Is this SVN (2.1) or something else?

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#9 Post by MaLblsH » Mon Dec 07, 2009 3:26 am

I`m sorry but what does it mean SVN?

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

#10 Post by TheWitness » Mon Dec 07, 2009 9:57 am

Browse from Here:

http://svn.cacti.net/viewvc/mactrack/tr ... ot=Plugins

Download from here:

http://www.cacti.net/svn.php

When downloading our plugins, use the repository name: cacti_plugins instead of cacti in the file path.

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#11 Post by MaLblsH » Wed Dec 09, 2009 3:15 am

We installed svn v1.1, put in the lib direcrory file mactrack_dlink_c1.php for scaning Dlink switches, put the string

Code: Select all

include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_dlink_c1.php"); 
into mactrack_vendors.php .
But nothing have been changed.
We cant`t get statistics from switches.

User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

#12 Post by gthe » Fri Dec 11, 2009 8:50 am

MaLblsH, try my new version of libs for Dlink switchs and Linux routers.
In mactrack_vendors.php I add:
include_once(dirname(__FILE__) . "/mactrack_dlink.php");
include_once(dirname(__FILE__) . "/mactrack_linux.php");
I test it on 3526 with Learned=Dynamic and Learned=DeleteOnTimeout.

There is only one thing - there is no support for gathering information about the interfaces, but I'm working on it
Attachments
mt_lib_for_dlink_and_linux.rar
(7.19 KiB) Downloaded 384 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]

MaLblsH
Posts: 8
Joined: Thu Mar 05, 2009 6:57 am
Location: Moscow, Russia

#13 Post by MaLblsH » Sun Dec 13, 2009 9:35 am

Thanks to all! It`s working now with! The theme is closed.
Thanks!!

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

#14 Post by TheWitness » Sun Dec 13, 2009 2:13 pm

Not quite. Gthe, PM me the revised DLink and Linux versions once you have the ifInterfaces work complete. I'll drop in SVN.

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

#15 Post by gthe » Mon Dec 14, 2009 10:19 am

Here is the fully mt v.2 style libs for dlink and linux routers.

TheWitness, I have one question. Many vendors libs call the function build_InterfacesTable, which has a request

Code: Select all

$ ifOperStatus = xform_standard_indexed_data ( ".1.3.6.1.2.1.2.2.1.8", $ device);
and then in libs again called

Code: Select all

$ active_ports_array = xform_standard_indexed_data ( ".1.3.6.1.2.1.2.2.1.8", $ device);
to count the number of active ports.
It may be better to return the status of the port from function build_InterfacesTable ?
It will require very little change:

Code: Select all

--- ./trunc/lib/mactrack_functions.php	2009-11-23 16:24:10.000000000 +0400
+++ ./mactrack/lib/mactrack_functions.php	2009-12-14 19:07:18.000000000 +0400
@@ -519,6 +519,7 @@
 		$ifInterfaces[$ifIndex]["ifIndex"] = $ifIndex;
 		$ifInterfaces[$ifIndex]["ifName"] = @$ifNames[$ifIndex];
 		$ifInterfaces[$ifIndex]["ifType"] = @$ifTypes[$ifIndex];
+		$ifInterfaces[$ifIndex]["ifOperStatus"] = @$ifOperStatus[$ifIndex];
 
 		if ($getLinkPorts) {
 			$ifInterfaces[$ifIndex]["linkPort"] = @$link_ports[$ifIndex];
Attachments
mt_lib_for_dlink_and_linux__ver2.rar
(3.37 KiB) Downloaded 347 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]

Post Reply