Cacti / plugin_mactrack

Mactrack Plugin for Cacti
GNU General Public License v2.0
12 stars 24 forks source link

missing tables: mac_track_aggregated_ports and mac_track_ports #166

Closed ralex75 closed 2 years ago

ralex75 commented 2 years ago

Describe the bug plugin installation not generating tables mac_track_aggregated_ports and mac_track_ports CMDPHP ERROR: A DB Exec Failed!, Error: Index column size too large. The maximum column size is 767 bytes. CMDPHP ERROR: A DB Exec Failed!, Error: Index column size too large. The maximum column size is 767 bytes.

To Reproduce Steps to reproduce the behavior:

  1. Go to in plugins directory
  2. git clone https://github.com/Cacti/plugin_mactrack.git and rename plugin_mactrack => mactrack
  3. from web ui install plugin
  4. mysql -uroot -proot
  5. use cacti; show tables => missing mac_track_aggregated_ports and mac_track_ports Generated Tables: mac_track_approved_macs
    mac_track_device_types
    mac_track_devices
    mac_track_dot1x
    mac_track_interface_graphs
    mac_track_interfaces
    mac_track_ip_ranges
    mac_track_ips
    mac_track_macauth
    mac_track_macwatch
    mac_track_oui_database
    mac_track_processes
    mac_track_scan_dates
    mac_track_scanning_functions
    mac_track_sites
    mac_track_snmp
    mac_track_snmp_items
    mac_track_temp_ports
    mac_track_vlans

Plugin (please complete the following information):

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Maria DB .cnf [mysqld] collation-server = utf8mb4_unicode_ci character-set-server=utf8mb4 max_heap_table_size = 256M max_connections = 5000 max_allowed_packet = 32M tmp_table_size = 256M join_buffer_size = 512M innodb_file_format = Barracuda innodb_large_prefix = 1 innodb_flush_log_at_timeout = 3 innodb_buffer_pool_size = 4GB innodb_buffer_pool_instances = 48 innodb_read_io_threads = 32 innodb_write_io_threads = 16 innodb_io_capacity = 5000 innodb_io_capacity_max = 10000 innodb_additional_mem_pool_size = 128M

ralex75 commented 2 years ago

Ok I found solution. SET GLOBAL innodb_default_row_format='dynamic'; It was 'COMPACT'. Now it works.

TheWitness commented 2 years ago

Glad you figured out.

netniV commented 2 years ago

Is that something we should have in the recommended cacti settings if not already there?

TheWitness commented 2 years ago

Yea, it's there. Just not in his setup.

TheWitness commented 2 years ago

He has large_prefix and Barracuda. Maybe he should check his setup. Maybe we need row_format=dynamic.

netniV commented 2 years ago

Yes it's that last part I was wondeirng.

TheWitness commented 2 years ago

I can add the row format dynamic, but that will infer a bump to the minimum Cacti version. Just a few releases ago we added the row_format table option to the table create API.

andersonreloaded commented 2 years ago

Ok I found solution. SET GLOBAL innodb_default_row_format='dynamic'; It was 'COMPACT'. Now it works.

This doesn't work with the MariaDB 5.5.52 that comes with CentOS 7. How can we fix this for such older versions of MariaDB ?

andersonreloaded commented 2 years ago

Found the fix. Setting following variables in server.cnf and restarting MariaDB server seems to work. Anything better please suggest.

innodb_file_format = Antelope innodb_file_format_max = Antelope innodb_large_prefix = 0