Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.64k stars 405 forks source link

Fresh 1.2.23 Install audit_database.php script reports errors #5237

Closed jlrcontegix closed 1 year ago

jlrcontegix commented 1 year ago

While troubleshooting another instance that has database issues, I decided to stand up a new instance for comparison purposes. After the initial install the audit_database.php script finds errors.

To Reproduce

Steps to reproduce the behavior:

  1. Follow installation routine, ensuring that all PHP and Database checks are green before completing installation.
    • Installation is on CentOS 7, PHP 7.4.33, MariaDB 10.10.3
  2. Run audit_database.php --report and see errors

Expected behavior

I would expect on a clean install to see no database errors.

WARNING: Forcing protocol to  TCP  due to option specification. Please explicitly state intended protocol.
SUCCESS: Loaded the Audit Schema
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graph_templates'                   - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graph_templates_graph'             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graph_templates_item'              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graphs'                            - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graphs_graph_item'                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'aggregate_graphs_items'                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_devices'                          - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_graph_rule_items'                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_graph_rules'                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_ips'                              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_match_rule_items'                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_networks'                         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_processes'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_snmp'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_snmp_items'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_templates'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_tree_rule_items'                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'automation_tree_rules'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'cdef'                                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'cdef_items'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'color_template_items'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'color_templates'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'colors'                                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_debug'
ERROR Col: 'info', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'
ERROR Col: 'issue', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 2, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'data_input'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_input_data'
ERROR Col: 'value', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'data_input_fields'                           - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_local'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_profiles'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_profiles_cf'                     - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_profiles_rra'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_purge_action'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_purge_temp'                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_daily'                     - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_hourly'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_hourly_cache'              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_hourly_last'               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_monthly'                   - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_weekly'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_source_stats_yearly'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_template'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_template_data'                          - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'data_template_rrd'                           - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'external_links'                              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_local'                                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_template_input'
ERROR Col: 'description', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'graph_template_input_defs'                   - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_templates'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_templates_gprint'                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_templates_graph'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_templates_item'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_tree'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'graph_tree_items'                            - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'host'
ERROR Col: 'notes', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'
ERROR Col: 'last_updated', Attribute 'Null' invalid. Should be: 'NO', Is: 'YES'

ERRORS: 2, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'host_graph'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'host_snmp_cache'
ERROR Col: 'oid', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'
ERROR Col: 'last_updated', Attribute 'Null' invalid. Should be: 'NO', Is: 'YES'

ERRORS: 2, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'host_snmp_query'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'host_template'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'host_template_graph'                         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'host_template_snmp_query'                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'plugin_config'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'plugin_db_changes'                           - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'plugin_hooks'                                - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'plugin_realms'
ERROR Col: 'file', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'poller'                                      - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_command'
ERROR Col: 'last_updated', Attribute 'Null' invalid. Should be: 'NO', Is: 'YES'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'poller_data_template_field_mappings'         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_item'
ERROR Col: 'last_updated', Attribute 'Null' invalid. Should be: 'NO', Is: 'YES'
ERROR Col: 'arg1', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 2, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'poller_output'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_output_boost'                         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_output_boost_local_data_ids'          - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_output_boost_processes'               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_output_realtime'
ERROR Col: 'output', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'poller_reindex'                              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_resource_cache'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'poller_time'                                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'processes'                                   - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'reports'
ERROR Col: 'from_email', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'
ERROR Col: 'email', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'
ERROR Col: 'bcc', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 3, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'reports_items'
ERROR Col: 'item_text', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'rrdcheck'                                    - Does not Exist.  Possible Plugin
---------------------------------------------------------------------------------------------
Checking Table: 'sessions'                                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'settings'                                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'settings_tree'
ERROR Col: 'status', Attribute 'Type' invalid. Should be: 'tinyint(3) unsigned', Is: 'tinyint(4)'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'settings_user'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'settings_user_group'                         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'sites'                                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmp_query'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmp_query_graph'                            - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmp_query_graph_rrd'                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmp_query_graph_rrd_sv'                     - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmp_query_graph_sv'                         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_cache'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_cache_notifications'               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_cache_textual_conventions'         - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_managers'
ERROR Col: 'notes', Attribute 'Type' invalid. Should be: 'mediumtext', Is: 'text'

ERRORS: 1, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_managers_notifications'            - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_mibs'                              - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'snmpagent_notifications_log'                 - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'table_columns'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'table_indexes'                               - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth'                                   - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_cache'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_group'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_group_members'                     - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_group_perms'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_group_realm'                       - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_perms'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_realm'                             - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_auth_row_cache'
ERROR Col: 'user_id', Attribute 'Type' invalid. Should be: 'mediumint(8) unsigned', Is: 'mediumint(8)'
ERROR Col: 'total_rows', Attribute 'Type' invalid. Should be: 'int(10)', Is: 'int(10) unsigned'

ERRORS: 2, WARNINGS: 0
---------------------------------------------------------------------------------------------
Checking Table: 'user_domains'                                - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_domains_ldap'                           - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'user_log'                                    - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'vdef'                                        - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'vdef_items'                                  - Clean
---------------------------------------------------------------------------------------------
Checking Table: 'version'                                     - Clean
---------------------------------------------------------------------------------------------
ERRORS are fixable using the --repair option.  WARNINGS will not be repaired
due to ambiguous use of the column.
---------------------------------------------------------------------------------------------
TheWitness commented 1 year ago

Thanks for reporting. The text issues are fixed in the 1.2.24, but the row cache bit is new.

TheWitness commented 1 year ago

Mostly resolved here. https://github.com/Cacti/cacti/commit/79cb027d926dc03cc1c1771fb23647d72efe4dc9

TheWitness commented 1 year ago

I just did a clean install, everything is checking out. If you pull a fresh copy of 1.2.24 and you get audit errors, you should run the repairs.