Place Your Feature Requests & Bug Reports Here

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

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

Post by TheWitness »

egarnel,

You will have to provide more detail on what should be exported.

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
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

NOTE TO MACTRACK ENTHUSIASTS - When performing the latest Database Upgrade, upon future database upgrades, you may receive error messages around the "description"->"note" field name change. These are harmless. I have to figure a way to suppress them.

Regards,

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?
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

TheWitness wrote:fabio,

In the latest SVN verson, I have added authentication information to the DEVICE. Also, I have allowed you to specify (on the device type level) a custom IP Scanning function. This will allow you to do three things:

1) Define your own ip scanning function at the device type (say PIX)
2) Supply a Userid/Password for authentication to that function (at the device level)
3) SSH to the PIX to obtain the ARP table and populate the database.

Your welcome. How ever, in return, can you please write this function? The SSH wrappers should get you out of the gate on this. What do you think?

TheWitness
This should not be a problem. I collect the pix arp table with no issues at all. Then again when I do that I am talking about using a different project as I am beta testing this project now. I think someone already stated in this string that you need to query the atTable. If I remember right the Table is accessible using net-snmp's snmptable.

Here is a good cisco link for cisco pix snmp stuff for the following:
Viewing Failover Status
Verifying Memory Usage
Viewing The Connection Count
Viewing System Buffer Usage

http://www.cisco.com/univercd/cc/td/doc ... vanced.htm

None the less I will let you all know tomorrow what OID I use for the other project I am involved in.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

lavermil,

In fact it is not in the atTable. It does not exist for the PIX, but only via a https or ssh request can you obtain this data. This is why I added this functionality for the posters previsous to your post. No biggy though.

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?
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

TheWitness wrote:NOTE TO MACTRACK ENTHUSIASTS - When performing the latest Database Upgrade, upon future database upgrades, you may receive error messages around the "description"->"note" field name change. These are harmless. I have to figure a way to suppress them.

Regards,

TheWitness
Here is the output of my database upgrade from the latest SVN. It looks like I got the errors you mentioned I would, but a few more as well:

su-2.05b# php database_upgrade.php
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_timeout, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_retries, Ok
SUCCESS: Add Column, Table -> mac_track_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ips, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_port, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> macs_active, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysName, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysLocation, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysContact, Already Exists!
SUCCESS: Create Table, Table -> mac_track_scanning_functions, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_devices', Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> total_oper_ports, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_device_types', Ok
SUCCESS: Add Index, Table -> mac_track_device_types, Index -> device_type_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> scanning_function, Ok
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> description, Ok
SUCCESS: Create Table, Table -> mac_track_scan_dates, Already Exists!
SUCCESS: Execute SQL, Addition of Scan Dates, Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysDescr, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysObjectID, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> port_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> dns_hostname, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ips_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> vlans_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_active, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_trunk, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> macs_active, Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> ip_address, Already Exists!
SUCCESS: Create Table, Table -> mac_track_ip_ranges, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_max_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_current_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> process_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Execute SQL, Change mac_track_temp_ports to Memory Table, Ok
SUCCESS: Execute SQL, Change mac_track_ips to Memory Table, Ok
SUCCESS: Create Table, Table -> mac_track_approved_macs, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ignorePorts, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Create Table, Table -> mac_track_oui_database, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_ports', Ok
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_temp_ports', Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> authorized, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> authorized, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macwatch, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macauth, Already Exists!
SUCCESS: Create Table, Table -> mac_track_vlans, Already Exists!
SUCCESS: Execute SQL, Add VLANS to VLAN Table, Ok
ERROR: Modify Column, Table -> mac_track_devices, Column -> description, Column Does NOT Exist!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> customer_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> netops_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> facilities_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> site_info, Already Exists!
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> serial_number_oid, Already Exists!
ERROR: Execute SQL, Move Device Names from the 'description' field to the 'device_name' field., Failed!
ERROR: Execute SQL, Blank out the 'description' field as it will now be used for something else, Failed!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> email_addresses, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> date_last_seen, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macauth, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> notes, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_ips, Column -> description, Ok
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> serial_number, Column Does NOT Exist!
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> asset_id, Column Does NOT Exist!
ERROR: Create Table, Table -> mac_track_interfaces, Failed!
SUCCESS: Add Column, Table -> mac_track_scanning_functions, Column -> type, Ok
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> ip_scanning_function, Ok
SUCCESS: Execute SQL, Update the Scanning Function Type to 'Mac' for undefined types, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to N/A for Device Type 1, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to 'get_standard_arp_table' for Routers and L3 Switches, Ok
ERROR: Add Column, Table -> mac_track_interfaces, Column -> vlan_trunk, Failed!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_name, Ok
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_password, Ok

Updating Device Types in Devices Table. Please be patient.
...................

Device Types Updated, You have '196' Good Device Type Mapping and '0' Bad Device Type Mapping.
If the Bad Device type mapping is greater than '0', you should inspect your devices for unmapped device types.

Importing the Vendor MAC Address Table from the IEEE

Getting OUI Database from the IEEE
OUI Database Download from IEEE Complete
.....................................................................................................
There were '10047' Entries Added/Updated in the database.
There were '0' Records Removed from the database.

Database Upgrade Complete
su-2.05b#

Is it still ok? Thanks.
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

TheWitness wrote:egarnel,

You will have to provide more detail on what should be exported.

TheWitness
que? I was wondering about having the ability to run the util from the web int on the fly
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

Witness,

I was just looking at the new version. I still have a lot to look at but so far. I have noticed the serial portion of the script to be a bit annoying. I always wants a value. If 0 is an option for it to try and figure it out then great, lets just note that on the line to the left, or auto populate things if they can be auto calculated.

In reference to figuring out the cisco servial number and chassis type here is a good link.

http://www.cisco.com/warp/public/477/SNMP/chassis.shtml

It shouldn't be too hard.
ChassisType (.1.3.6.1.4.1.9.3.6.1): Identifies the kind of router the device is. Translate to the proper cisco chassis type using OLD-CISCO-CHASSIS-MIB.

chassisId (.1.3.6.1.4.1.9.3.6.3): Unique ID string. Defaults to chassis serial number if available; otherwise empty. Can also be set with the "snmp-server chassis-id" <text> command.

Lastly, I think a very helpful report would be a report of MAC addresses that do not match to any ip addresses. This is helpful when trying locate failover server ports. I am sure that is extremely easy to do. I just haven't had the time to look in the DB to see if they are stored if they don't TIE to an IP.

I will see what I can do on this tonight.

-Lance
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

chadd wrote:
TheWitness wrote:NOTE TO MACTRACK ENTHUSIASTS - When performing the latest Database Upgrade, upon future database upgrades, you may receive error messages around the "description"->"note" field name change. These are harmless. I have to figure a way to suppress them.

Regards,

TheWitness
Here is the output of my database upgrade from the latest SVN. It looks like I got the errors you mentioned I would, but a few more as well:

su-2.05b# php database_upgrade.php
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_timeout, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_retries, Ok
SUCCESS: Add Column, Table -> mac_track_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ips, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_port, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> macs_active, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysName, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysLocation, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysContact, Already Exists!
SUCCESS: Create Table, Table -> mac_track_scanning_functions, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_devices', Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> total_oper_ports, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_device_types', Ok
SUCCESS: Add Index, Table -> mac_track_device_types, Index -> device_type_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> scanning_function, Ok
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> description, Ok
SUCCESS: Create Table, Table -> mac_track_scan_dates, Already Exists!
SUCCESS: Execute SQL, Addition of Scan Dates, Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysDescr, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysObjectID, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> port_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> dns_hostname, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ips_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> vlans_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_active, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_trunk, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> macs_active, Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> ip_address, Already Exists!
SUCCESS: Create Table, Table -> mac_track_ip_ranges, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_max_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_current_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> process_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Execute SQL, Change mac_track_temp_ports to Memory Table, Ok
SUCCESS: Execute SQL, Change mac_track_ips to Memory Table, Ok
SUCCESS: Create Table, Table -> mac_track_approved_macs, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ignorePorts, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Create Table, Table -> mac_track_oui_database, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_ports', Ok
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_temp_ports', Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> authorized, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> authorized, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macwatch, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macauth, Already Exists!
SUCCESS: Create Table, Table -> mac_track_vlans, Already Exists!
SUCCESS: Execute SQL, Add VLANS to VLAN Table, Ok
ERROR: Modify Column, Table -> mac_track_devices, Column -> description, Column Does NOT Exist!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> customer_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> netops_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> facilities_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> site_info, Already Exists!
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> serial_number_oid, Already Exists!
ERROR: Execute SQL, Move Device Names from the 'description' field to the 'device_name' field., Failed!
ERROR: Execute SQL, Blank out the 'description' field as it will now be used for something else, Failed!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> email_addresses, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> date_last_seen, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macauth, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> notes, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_ips, Column -> description, Ok
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> serial_number, Column Does NOT Exist!
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> asset_id, Column Does NOT Exist!
ERROR: Create Table, Table -> mac_track_interfaces, Failed!
SUCCESS: Add Column, Table -> mac_track_scanning_functions, Column -> type, Ok
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> ip_scanning_function, Ok
SUCCESS: Execute SQL, Update the Scanning Function Type to 'Mac' for undefined types, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to N/A for Device Type 1, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to 'get_standard_arp_table' for Routers and L3 Switches, Ok
ERROR: Add Column, Table -> mac_track_interfaces, Column -> vlan_trunk, Failed!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_name, Ok
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_password, Ok

Updating Device Types in Devices Table. Please be patient.
...................

Device Types Updated, You have '196' Good Device Type Mapping and '0' Bad Device Type Mapping.
If the Bad Device type mapping is greater than '0', you should inspect your devices for unmapped device types.

Importing the Vendor MAC Address Table from the IEEE

Getting OUI Database from the IEEE
OUI Database Download from IEEE Complete
.....................................................................................................
There were '10047' Entries Added/Updated in the database.
There were '0' Records Removed from the database.

Database Upgrade Complete
su-2.05b#

Is it still ok? Thanks.
I think the reason you are running into this is you are not upgraded to the current code by sequencial order. I had an issue with it, until I started at the beginning from a version on cactiusers.org (which is a bad version) then I upgraded and I don't get those errors. This exact reason is why I would like to see a correct mactrack.sql file to import into my DB.
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

lavermil wrote:
chadd wrote:
TheWitness wrote:NOTE TO MACTRACK ENTHUSIASTS - When performing the latest Database Upgrade, upon future database upgrades, you may receive error messages around the "description"->"note" field name change. These are harmless. I have to figure a way to suppress them.

Regards,

TheWitness
Here is the output of my database upgrade from the latest SVN. It looks like I got the errors you mentioned I would, but a few more as well:

su-2.05b# php database_upgrade.php
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_timeout, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_retries, Ok
SUCCESS: Add Column, Table -> mac_track_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ips, Column -> dns_hostname, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_port, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> macs_active, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysName, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysLocation, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> snmp_sysContact, Already Exists!
SUCCESS: Create Table, Table -> mac_track_scanning_functions, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_devices', Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> total_oper_ports, Already Exists!
SUCCESS: Execute SQL, Change Primary Key For 'mac_track_device_types', Ok
SUCCESS: Add Index, Table -> mac_track_device_types, Index -> device_type_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> scanning_function, Ok
SUCCESS: Modify Column, Table -> mac_track_scanning_functions, Column -> description, Ok
SUCCESS: Create Table, Table -> mac_track_scan_dates, Already Exists!
SUCCESS: Execute SQL, Addition of Scan Dates, Ok
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysDescr, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> snmp_sysObjectID, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_type_id, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> port_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> dns_hostname, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ips_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> vlans_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_total, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_active, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ports_trunk, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> macs_active, Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> updated, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> ip_address, Already Exists!
SUCCESS: Create Table, Table -> mac_track_ip_ranges, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_max_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ip_ranges, Column -> ips_current_date, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> device_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_processes, Column -> process_id, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Execute SQL, Change mac_track_temp_ports to Memory Table, Ok
SUCCESS: Execute SQL, Change mac_track_ips to Memory Table, Ok
SUCCESS: Create Table, Table -> mac_track_approved_macs, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> ignorePorts, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstring, Ok
SUCCESS: Modify Column, Table -> mac_track_devices, Column -> snmp_readstrings, Ok
SUCCESS: Create Table, Table -> mac_track_oui_database, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> vendor_mac, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> vendor_mac, Already Exists!
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_ports', Ok
SUCCESS: Execute SQL, Add Vendor Macs To 'mac_track_temp_ports', Ok
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_temp_ports, Index -> authorized, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> authorized, Already Exists!
SUCCESS: Add Index, Table -> mac_track_ports, Index -> authorized, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macwatch, Already Exists!
SUCCESS: Create Table, Table -> mac_track_macauth, Already Exists!
SUCCESS: Create Table, Table -> mac_track_vlans, Already Exists!
SUCCESS: Execute SQL, Add VLANS to VLAN Table, Ok
ERROR: Modify Column, Table -> mac_track_devices, Column -> description, Column Does NOT Exist!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> device_name, Already Exists!
SUCCESS: Add Index, Table -> mac_track_devices, Index -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> customer_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> netops_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> facilities_contact, Already Exists!
SUCCESS: Add Column, Table -> mac_track_sites, Column -> site_info, Already Exists!
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> serial_number_oid, Already Exists!
ERROR: Execute SQL, Move Device Names from the 'description' field to the 'device_name' field., Failed!
ERROR: Execute SQL, Blank out the 'description' field as it will now be used for something else, Failed!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> email_addresses, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macwatch, Column -> date_last_seen, Already Exists!
SUCCESS: Add Column, Table -> mac_track_macauth, Column -> mac_id, Already Exists!
SUCCESS: Add Column, Table -> mac_track_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_temp_ports, Column -> device_name, Already Exists!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> notes, Already Exists!
SUCCESS: Modify Column, Table -> mac_track_ips, Column -> description, Ok
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> serial_number, Column Does NOT Exist!
SUCCESS: Delete Column, Table -> mac_track_devices, Column -> asset_id, Column Does NOT Exist!
ERROR: Create Table, Table -> mac_track_interfaces, Failed!
SUCCESS: Add Column, Table -> mac_track_scanning_functions, Column -> type, Ok
SUCCESS: Add Column, Table -> mac_track_device_types, Column -> ip_scanning_function, Ok
SUCCESS: Execute SQL, Update the Scanning Function Type to 'Mac' for undefined types, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to N/A for Device Type 1, Ok
SUCCESS: Execute SQL, Set the IP Scanning function to 'get_standard_arp_table' for Routers and L3 Switches, Ok
ERROR: Add Column, Table -> mac_track_interfaces, Column -> vlan_trunk, Failed!
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_name, Ok
SUCCESS: Add Column, Table -> mac_track_devices, Column -> user_password, Ok

Updating Device Types in Devices Table. Please be patient.
...................

Device Types Updated, You have '196' Good Device Type Mapping and '0' Bad Device Type Mapping.
If the Bad Device type mapping is greater than '0', you should inspect your devices for unmapped device types.

Importing the Vendor MAC Address Table from the IEEE

Getting OUI Database from the IEEE
OUI Database Download from IEEE Complete
.....................................................................................................
There were '10047' Entries Added/Updated in the database.
There were '0' Records Removed from the database.

Database Upgrade Complete
su-2.05b#

Is it still ok? Thanks.
I think the reason you are running into this is you are not upgraded to the current code by sequencial order. I had an issue with it, until I started at the beginning from a version on cactiusers.org (which is a bad version) then I upgraded and I don't get those errors. This exact reason is why I would like to see a correct mactrack.sql file to import into my DB.
Witness,

Could you do an export of your database update the sql file so if someone wants to start fresh they can. They don't have to use an outdated sql file and then run database_upgrade.php. I am seeing if I can make one right now.
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

I am sorting the MAC-IP report in a better fashion than you are. I am using Natural sort a php function.

natsort
http://us2.php.net/manual/en/function.natsort.php

Below I took a modified natsort from the webpage above and made it look right. Insert the code at about line 1745 in mactrack_view.php

function array_natsort_list($array) {
// for all arguments without the first starting at end of list
for ($i=func_num_args();$i>1;$i--) {
// get column to sort by
$sort_by = func_get_arg($i-1);
// clear arrays
$new_array = array();
$temporary_array = array();
// walk through original array
foreach($array as $original_key => $original_value) {
// and save only values
$temporary_array[] = $original_value[$sort_by];
}
// sort array on values
natsort($temporary_array);
// delete double values
$temporary_array = array_unique($temporary_array);
// walk through temporary array
foreach($temporary_array as $temporary_value) {
// walk through original array
foreach($array as $original_key => $original_value) {
// and search for entries having the right value
if($temporary_value == $original_value[$sort_by]) {
// save in new array
$new_array[$original_key] = $original_value;
}
}
}
// update original array
$array = $new_array;
}
return $array;
}
$port_results = array_natsort_list($port_results, 'port_number');

I hope this helps someone.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

lavermil,

Natural sorting is problematic when you are sorting large set's of Data. You can use MySQL's IP style sorting much better. I frankly don't know if I'm using it in MacTrack, but it was designed for IP Addresses.

Do the research, but don't use Natural sorting, because the LIMIT in the SQL code kind of makes it pointless.

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
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Chadd,

What version of MySQL are you using. My fear is that I have hosed something in the Interfaces table creation. Those two errors at the end point to it. Take the SQL code in the database_upgrade script and paste into either a mysql command prompt or via Query Browser and see what becomes of it.

I will not likely get to fixing that until later this week. To many things came up. I am only answering a few posts tonight.

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?
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

mysql Ver 14.12 Distrib 5.1.6-alpha, for portbld-freebsd6.1 (i386) using 5.0

I will try that and post the results.
lavermil
Posts: 45
Joined: Thu Feb 15, 2007 2:25 pm
Location: Phoenix, Arizona

Post by lavermil »

TheWitness wrote:Chadd,

What version of MySQL are you using. My fear is that I have hosed something in the Interfaces table creation. Those two errors at the end point to it. Take the SQL code in the database_upgrade script and paste into either a mysql command prompt or via Query Browser and see what becomes of it.

I will not likely get to fixing that until later this week. To many things came up. I am only answering a few posts tonight.

TheWitness

Chadd/Witness,

Here is where the issue is. Just remove what I have in bold from database_upgrade.php and you will have no issues.

create_table("mac_track_interfaces", "CREATE TABLE `cacti086`.`mac_track_interfaces` (`site_id` int(10) unsigned NOT NULL default '0',

I have also attached a correct version of the database.php file.
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Yeah, I got there just before I read your post.. Must be a test bed database the Witness uses ;-).. I still have an error, but it is just because there is not check for rather or not the description field has already been modified in the mac_track_ips table.

Thanks,

-chadd.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest