End Device Tracking Add-On for Cacti

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

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

Post by TheWitness »

Ok. For those interested in the MacTrack module. You will have to either have the Plugin architecture, or be willing to set it up on a separate box to protect your production environment.

The good thing about MacTrack is that it does not need to run from your main system. You can run it on a server adjacent to it or somewhere else for that matter.

If you use the plugin architecture follow those steps. If you don't and have another box. Install a separate cacti instance on the new box. Then, on that new box, overlay the "native" version of MacTrack directly over the top of your Cacti installation. Then, instead of scheduling poller.php, schedule poller_mactrack.php to run every 5 minutes.

Import your devices and you are done.

With respect to getting it from SVN, please follow the instructions on the attached post:

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

For Unix, in the following line:

Code: Select all

svn checkout svn://svn.cacti.net/var/svnroot/cacti
replace ".../svnroot/cacti" with ".../svnroot/mactrack" and you are all done.

If you have Windows, you will need Tourtoise SVN. It can be found here:

http://tortoisesvn.tigris.org/

After it is installed, create an empty folder, right click on it and select SVN Checkout. In the dialog provided enter the following:

Code: Select all

svn://svn.cacti.net/var/svnroot/mactrack
That's it. Not quite ready for prime time, but I am following a path that allows you to keep up with updates.

Regards,

TheWitness[/url]
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?
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Plugin version is currently fully synched up to the native code.
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

cigamit wrote:Plugin version is currently fully synched up to the native code.
Thank you for converting.
Some issues I found:
- clicking on the slider "mactrack" I get the mactrack site and the console slider (even if I have no console rights)
- choosing at the show dropdown-list not "Most recent" but a scan time i get a "Validation error. "

Torsten
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

TheWitness wrote:I am still having problems with the 4006. More to follow.
I appreciate it, and the heads-up. For the record, I now have 5 devices configured but three are erroring out with the incorrect scanner type error (based on what I'm seeing through phpMyAdmin). However, from the site page it shows 718 IPs, the device page still shows nothing for any of the devices (ports or IPs). When I run it manually I get a bunch of lines saying:

PHP Notice: Undefined index: 255 in /usr/share/cacti/plugins/mactrack/lib/mactrack_cisco.php on line 272

Also, when you click on the mactrack tab, shouldn't it go to a new tab? Mine is staying in the console tab with a new page (not sure how to better explain it).
TheWitness wrote:I will answer the SVN thing momentarily. Don't know if Ian has opened anonymous SVN.
Again, I do appreciate your work. I'll also note that I was able to get into the repository via viewcvs and a browser. This method requires me, best I can figure out, to download the files individually rather than just checking out all of the code...I guess. Perhaps I just didn't have the path correct... look forward to your post(s). :)
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

Just updated with the code for the plugin, posted today. Same issues except that now the only errors I'm getting are:

PHP Notice: Undefined index: snmp_sysContact in /usr/share/cacti/plugins/mactrack/lib/mactrack_functions.php on line 855

Still updates the site IP count but nothing for the devices.
{UPDATE} I looked in the database and one switch is having its information collected in mac_track_posts. The devices table is empty - which I just noticed isn't being touched when I run the poller.

The site does include one 4006 but also a 6500, 3500 and one other - only the 6500 is showing up in the posts table.
Last edited by knobdy on Tue Jan 10, 2006 10:31 am, edited 2 times in total.
gashalot
Posts: 9
Joined: Wed Sep 07, 2005 3:04 pm

Issues with no active ports...

Post by gashalot »

I'm trying to poll a 6509 with an older SupII engine in it, but for some reason the scanning isn't picking up on any active ports, even though there are a number of active ports.

Judging from the scanner output, it is finding a large list of MAC addresses as well as IP's, but it doesn't pick up on any active ports. I'm using the get_IOS_dot1dTpFdbEntry_ports scanning function.

Does anyone know why this might be happening?

Here's a snippet from the DEBUG logs from mactrack_scanner:

DEBUG: Port mac address information collected.
DEBUG: Bridge port information about to be collected.
DEBUG: VLAN_ID: 16, VLAN_NAME: xxxxxx, ACTIVE PORTS: 8
DEBUG: Bridge port information collection complete.
.... snip ....
DEBUG: HOST: xxxxxxxxxx, IP address information collection complete
DEBUG: SQL: UPDATE mac_track_devices SET ports_total='133',vlans_total='134',ports_active='0',ports_trunk='12',macs_active='0'
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

Hello developer,

at my db I found that the field scanning function in table "mac_track_scanning_functions" is to short for the new function "get_catalyst_dot1dTpFdbEntry_ports" (i changed it from 30 to 50 chars.) At table "mac_track_device_types " the length is set to 100.

This wrong setting is applied by the php script database_upgrade.php.

Torsten
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

torstentfk wrote:
cigamit wrote:Plugin version is currently fully synched up to the native code.
Thank you for converting.
Some issues I found:
- clicking on the slider "mactrack" I get the mactrack site and the console slider (even if I have no console rights)
- choosing at the show dropdown-list not "Most recent" but a scan time i get a "Validation error. "

Torsten
OK, I just fixed both of these and have committed them. The only file necessary for you to update is mactrak_view.php to test it out.
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

cigamit wrote:
torstentfk wrote:
cigamit wrote:Plugin version is currently fully synched up to the native code.
Thank you for converting.
Some issues I found:
- clicking on the slider "mactrack" I get the mactrack site and the console slider (even if I have no console rights)
- choosing at the show dropdown-list not "Most recent" but a scan time i get a "Validation error. "

Torsten
OK, I just fixed both of these and have committed them. The only file necessary for you to update is mactrak_view.php to test it out.
OK -tested and all went good - thanks for fast fixing. Did you investigate the db-issue about the length of the field "mac..function"?

T.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

torstentfk wrote: OK -tested and all went good - thanks for fast fixing. Did you investigate the db-issue about the length of the field "mac..function"?

T.
I just fixed in the plugin version, I will leave it up to Larry to fix it on the native side (I set it to 100 since that is what the device type table allows, but he may want it changed to something else later). The fix won't update your current one, you will have to do that yourself, you can do so with this command

Code: Select all

ALTER TABLE `mac_track_scanning_functions` MODIFY COLUMN `scanning_function` VARCHAR(100) NOT NULL DEFAULT ''
Not sure if Larry wants to put that in the database upgrade script, or just modify it for the v1.0 release.
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

cigamit wrote:OK, I just fixed both of these and have committed them. The only file necessary for you to update is mactrak_view.php to test it out.
I've updated this file and the tab now does open outside of the console. However there aren't the old options for searching, listing all (which didn't work) and listing most recent.

I'm not showing anything on the tab though I have managed to get the devices to start displaying ports and such (I "re"-upgraded the DB...and some other things I've already forgotten).

Cacti[846]: CMDPHP: ERROR: SQL Exec Failed "UPDATE mac_track_devices SET ports_total='28',vlans_total='24',ports_active='0',ports_trunk='0',macs_active='0',snmp_readstring= '02r',snmp_sysName='_kc1s3',snmp_sysLocation='Building 1st Floor',snmp_sysContact=' ',snmp_sysObjectID='.1.3.6.1.4.1.9.1.248',snmp_sysDescr='Cisco Internetwork Operating System Softwa re IOS (tm) C3500XL Software (C3500XL-C3H2S-M), Version 12.0(5)WC13, RELEASE SOFTWARE (fc1) Copy right (c) 1986-2005 by cisco Systems, Inc.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

knobdy wrote:Just updated with the code for the plugin, posted today. Same issues except that now the only errors I'm getting are:

PHP Notice: Undefined index: snmp_sysContact in /usr/share/cacti/plugins/mactrack/lib/mactrack_functions.php on line 855

Still updates the site IP count but nothing for the devices.
{UPDATE} I looked in the database and one switch is having its information collected in mac_track_posts. The devices table is empty - which I just noticed isn't being touched when I run the poller.

The site does include one 4006 but also a 6500, 3500 and one other - only the 6500 is showing up in the posts table.
Have you recently ran the database_upgrade.php script? It adds the "snmp_sysContact" column to the table.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Also, you must insure that you have a valid "Device Type" setup for each of these devices.

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?
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

cigamit wrote:Have you recently ran the database_upgrade.php script? It adds the "snmp_sysContact" column to the table.
Well, there's an issue. I had run it but apparently - as I found when I ran it again:

Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_ports` ADD COLUMN `dns_hostname` VARCHAR(200) DEFAULT '' AFTER `hostname`;"
Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_ips` ADD COLUMN `dns_hostname` VARCHAR(200) DEFAULT '' AFTER `ip_address`;"
Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_port` INT(10) UNSIGNED NOT NULL DEFAULT '161' AFTER `snmp_version`;"
Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` ADD COLUMN `macs_active` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `ports_trunk`;"
Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_sysName` VARCHAR(100) DEFAULT '' AFTER `snmp_retries`;"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_sysLocation` VARCHAR(100) DEFAULT '' AFTER `snmp_sysName`;"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_sysContact` VARCHAR(100) DEFAULT '' AFTER `snmp_sysLocation`;"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "CREATE TABLE `mac_track_scanning_functions` (`scanning_function` VARCHAR(50) NOT NULL DEFAULT '', `description` VARCHAR(100) NOT NULL DEFAULT '', PRIMARY KEY(`scanning_function`))"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_devices` DROP PRIMARY KEY, ADD PRIMARY KEY(`hostname`, `snmp_port`, `site_id`), ADD INDEX `device_id`(`device_id`)"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_sites` ADD COLUMN `total_oper_ports` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `total_user_ports`;"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_device_types` DROP PRIMARY KEY, ADD PRIMARY KEY(`sysDescr_match`, `sysObjectID_match`, `device_type`), ADD INDEX `device_type_id`(`device_type_id`)"
Jan 10 14:53:16 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "CREATE TABLE `mac_track_scan_dates` (`scan_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY(`scan_date`));"

Obviously I'm not doing something right...?
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

knobdy wrote:
cigamit wrote:Have you recently ran the database_upgrade.php script? It adds the "snmp_sysContact" column to the table.
Well, there's an issue. I had run it but apparently - as I found when I ran it again:

Jan 10 14:53:15 -ns02n Cacti[21295]: CMDPHP: ERROR: SQL Exec Failed "ALTER TABLE `mac_track_ports` ADD COLUMN `dns_hostname` VARCHAR(200) DEFAULT '' AFTER `hostname`;"

Obviously I'm not doing something right...?
Actually, if you had ran it before, some of those are going to fail, you can't add columns that already exist. I wouldn't worry about those errors, the real question is if you still get the same errors as before in Mactrack.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests