Differences/delay last update and last check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jmsanesteban.sgre
Posts: 51
Joined: Thu Apr 23, 2020 6:46 am

Re: Differences/delay last update and last check

Post by jmsanesteban.sgre »

ssax wrote:I'm not sure what these tables are but they look crashed:

Code: Select all

'SAIM_comments_view', NULL
'SAIM_old_API_Values_view', NULL
'SAIM_old_view', NULL
'SAIM_view', NULL
If those are in the nagios database I wouldn't recommend that you use our databases when adding new tables/etc, you should create a separate database for them so it doesn't impact any of the functionality of the XI app (backup scripts/etc).
Those tables are views that we are using for a light integration between products, so in theory they won't affect. We query those tables every 5 min.
ssax wrote: You may need to reach out to whoever manages the database to get access to information.
I can talk with DBA, so I can request information, but I can't have admin rights.


ssax wrote: I need the one for the nagiosxi DB as well:
- You can get the X.X.X.X/user/pass from /usr/local/nagiosxi/html/config.inc.php

Code: Select all

echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagiosxi');" | mysql -h X.X.X.X -uyourusername -p'yourpassword' nagiosXI --table
MySQL [nagiosXI]> SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagiosXI');
+---------------------+------------+
| Table | Size in MB |
+---------------------+------------+
| xi_auditlog | 3.66 |
| xi_auth_tokens | 0.31 |
| xi_cmp_trapdata | 0.03 |
| xi_cmp_trapdata_log | 0.03 |
| xi_commands | 0.02 |
| xi_eventqueue | 0.03 |
| xi_events | 0.75 |
| xi_meta | 12.52 |
| xi_mibs | 0.05 |
| xi_options | 0.06 |
| xi_sessions | 0.03 |
| xi_sysstat | 0.03 |
| xi_usermeta | 0.36 |
| xi_users | 0.06 |
+---------------------+------------+
14 rows in set (0.00 sec)

I thought it could be a problem with crashed tables, but mysqlcheck says that all tables are OK.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Differences/delay last update and last check

Post by ssax »

You should make sure you XI backups are completing properly as I'm pretty sure it will cause your backups to fail if you have other crashed tables in our databases (and our repair scripts won't fix those tables).

Try running this command to clear out some temporary tables to see if that alleviates it:
- You can get the X.X.X.X/user/pass from /usr/local/nagiosxi/html/config.inc.php

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -h X.X.X.X -uyourusername -p'yourpassword' nagiosXI
If that doesn't, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/

Thank you!
jmsanesteban.sgre
Posts: 51
Joined: Thu Apr 23, 2020 6:46 am

Re: Differences/delay last update and last check

Post by jmsanesteban.sgre »

ssax wrote:You should make sure you XI backups are completing properly as I'm pretty sure it will cause your backups to fail if you have other crashed tables in our databases (and our repair scripts won't fix those tables).
I'm not sure about that. For server backups we are relying on virtualization capabilites, regarding the database information, we have all data in an offloaded databases with its own backups system. The repair_databases scripts seems to fail due to the engine capabilites but the check seems to work properly and in theory there is no crashed table:

nagios db

Code: Select all

mysqlcheck -c -u unagios -h 10.140.96.112 --port=3306 --databases nagios -p
Enter password:
nagios.nagios_acknowledgements                     OK
nagios.nagios_commands                             OK
nagios.nagios_commenthistory                       OK
nagios.nagios_comments                             OK
nagios.nagios_configfiles                          OK
nagios.nagios_configfilevariables                  OK
nagios.nagios_conninfo                             OK
nagios.nagios_contact_addresses                    OK
nagios.nagios_contact_notificationcommands         OK
nagios.nagios_contactgroup_members                 OK
nagios.nagios_contactgroups                        OK
nagios.nagios_contactnotificationmethods           OK
nagios.nagios_contactnotifications                 OK
nagios.nagios_contacts                             OK
nagios.nagios_contactstatus                        OK
nagios.nagios_customvariables                      OK
nagios.nagios_customvariablestatus                 OK
nagios.nagios_dbversion                            OK
nagios.nagios_downtimehistory                      OK
nagios.nagios_eventhandlers                        OK
nagios.nagios_externalcommands                     OK
nagios.nagios_flappinghistory                      OK
nagios.nagios_host_contactgroups                   OK
nagios.nagios_host_contacts                        OK
nagios.nagios_host_parenthosts                     OK
nagios.nagios_hostchecks                           OK
nagios.nagios_hostdependencies                     OK
nagios.nagios_hostescalation_contactgroups         OK
nagios.nagios_hostescalation_contacts              OK
nagios.nagios_hostescalations                      OK
nagios.nagios_hostgroup_members                    OK
nagios.nagios_hostgroups                           OK
nagios.nagios_hosts                                OK
nagios.nagios_hoststatus                           OK
nagios.nagios_instances                            OK
nagios.nagios_logentries                           OK
nagios.nagios_notifications                        OK
nagios.nagios_objects                              OK
nagios.nagios_processevents                        OK
nagios.nagios_programstatus                        OK
nagios.nagios_runtimevariables                     OK
nagios.nagios_scheduleddowntime                    OK
nagios.nagios_service_contactgroups                OK
nagios.nagios_service_contacts                     OK
nagios.nagios_service_parentservices               OK
nagios.nagios_servicechecks                        OK
nagios.nagios_servicedependencies                  OK
nagios.nagios_serviceescalation_contactgroups      OK
nagios.nagios_serviceescalation_contacts           OK
nagios.nagios_serviceescalations                   OK
nagios.nagios_servicegroup_members                 OK
nagios.nagios_servicegroups                        OK
nagios.nagios_services                             OK
nagios.nagios_servicestatus                        OK
nagios.nagios_statehistory                         OK
nagios.nagios_systemcommands                       OK
nagios.nagios_timedeventqueue                      OK
nagios.nagios_timedevents                          OK
nagios.nagios_timeperiod_timeranges                OK
nagios.nagios_timeperiods                          OK
NagiosXI

Code: Select all

 mysqlcheck -c -u unagiosxi -h 10.140.96.112 --port=3306 --databases nagiosXI -p
Enter password:
nagiosXI.xi_auditlog                               OK
nagiosXI.xi_auth_tokens                            OK
nagiosXI.xi_cmp_trapdata                           OK
nagiosXI.xi_cmp_trapdata_log                       OK
nagiosXI.xi_commands                               OK
nagiosXI.xi_eventqueue                             OK
nagiosXI.xi_events                                 OK
nagiosXI.xi_meta                                   OK
nagiosXI.xi_mibs                                   OK
nagiosXI.xi_options                                OK
nagiosXI.xi_sessions                               OK
nagiosXI.xi_sysstat                                OK
nagiosXI.xi_usermeta                               OK
nagiosXI.xi_users                                  OK
nagiossql

Code: Select all

mysqlcheck -c -u unagiossql -h 10.140.96.112 --port=3306 --databases nagiosSQL -p
Enter password:
nagiosSQL.tbl_command                              OK
nagiosSQL.tbl_contact                              OK
nagiosSQL.tbl_contactgroup                         OK
nagiosSQL.tbl_contacttemplate                      OK
nagiosSQL.tbl_domain                               OK
nagiosSQL.tbl_host                                 OK
nagiosSQL.tbl_hostdependency                       OK
nagiosSQL.tbl_hostescalation                       OK
nagiosSQL.tbl_hostextinfo                          OK
nagiosSQL.tbl_hostgroup                            OK
nagiosSQL.tbl_hosttemplate                         OK
nagiosSQL.tbl_info                                 OK
nagiosSQL.tbl_lnkContactToCommandHost              OK
nagiosSQL.tbl_lnkContactToCommandService           OK
nagiosSQL.tbl_lnkContactToContactgroup             OK
nagiosSQL.tbl_lnkContactToContacttemplate          OK
nagiosSQL.tbl_lnkContactToVariabledefinition       OK
nagiosSQL.tbl_lnkContactgroupToContact             OK
nagiosSQL.tbl_lnkContactgroupToContactgroup        OK
nagiosSQL.tbl_lnkContacttemplateToCommandHost      OK
nagiosSQL.tbl_lnkContacttemplateToCommandService   OK
nagiosSQL.tbl_lnkContacttemplateToContactgroup     OK
nagiosSQL.tbl_lnkContacttemplateToContacttemplate  OK
nagiosSQL.tbl_lnkContacttemplateToVariabledefinition OK
nagiosSQL.tbl_lnkHostToContact                     OK
nagiosSQL.tbl_lnkHostToContactgroup                OK
nagiosSQL.tbl_lnkHostToHost                        OK
nagiosSQL.tbl_lnkHostToHostgroup                   OK
nagiosSQL.tbl_lnkHostToHosttemplate                OK
nagiosSQL.tbl_lnkHostToVariabledefinition          OK
nagiosSQL.tbl_lnkHostdependencyToHost_DH           OK
nagiosSQL.tbl_lnkHostdependencyToHost_H            OK
nagiosSQL.tbl_lnkHostdependencyToHostgroup_DH      OK
nagiosSQL.tbl_lnkHostdependencyToHostgroup_H       OK
nagiosSQL.tbl_lnkHostescalationToContact           OK
nagiosSQL.tbl_lnkHostescalationToContactgroup      OK
nagiosSQL.tbl_lnkHostescalationToHost              OK
nagiosSQL.tbl_lnkHostescalationToHostgroup         OK
nagiosSQL.tbl_lnkHostgroupToHost                   OK
nagiosSQL.tbl_lnkHostgroupToHostgroup              OK
nagiosSQL.tbl_lnkHosttemplateToContact             OK
nagiosSQL.tbl_lnkHosttemplateToContactgroup        OK
nagiosSQL.tbl_lnkHosttemplateToHost                OK
nagiosSQL.tbl_lnkHosttemplateToHostgroup           OK
nagiosSQL.tbl_lnkHosttemplateToHosttemplate        OK
nagiosSQL.tbl_lnkHosttemplateToVariabledefinition  OK
nagiosSQL.tbl_lnkServiceToContact                  OK
nagiosSQL.tbl_lnkServiceToContactgroup             OK
nagiosSQL.tbl_lnkServiceToHost                     OK
nagiosSQL.tbl_lnkServiceToHostgroup                OK
nagiosSQL.tbl_lnkServiceToServicegroup             OK
nagiosSQL.tbl_lnkServiceToServicetemplate          OK
nagiosSQL.tbl_lnkServiceToVariabledefinition       OK
nagiosSQL.tbl_lnkServicedependencyToHost_DH        OK
nagiosSQL.tbl_lnkServicedependencyToHost_H         OK
nagiosSQL.tbl_lnkServicedependencyToHostgroup_DH   OK
nagiosSQL.tbl_lnkServicedependencyToHostgroup_H    OK
nagiosSQL.tbl_lnkServicedependencyToService_DS     OK
nagiosSQL.tbl_lnkServicedependencyToService_S      OK
nagiosSQL.tbl_lnkServicedependencyToServicegroup_DS OK
nagiosSQL.tbl_lnkServicedependencyToServicegroup_S OK
nagiosSQL.tbl_lnkServiceescalationToContact        OK
nagiosSQL.tbl_lnkServiceescalationToContactgroup   OK
nagiosSQL.tbl_lnkServiceescalationToHost           OK
nagiosSQL.tbl_lnkServiceescalationToHostgroup      OK
nagiosSQL.tbl_lnkServiceescalationToService        OK
nagiosSQL.tbl_lnkServiceescalationToServicegroup   OK
nagiosSQL.tbl_lnkServicegroupToService             OK
nagiosSQL.tbl_lnkServicegroupToServicegroup        OK
nagiosSQL.tbl_lnkServicetemplateToContact          OK
nagiosSQL.tbl_lnkServicetemplateToContactgroup     OK
nagiosSQL.tbl_lnkServicetemplateToHost             OK
nagiosSQL.tbl_lnkServicetemplateToHostgroup        OK
nagiosSQL.tbl_lnkServicetemplateToServicegroup     OK
nagiosSQL.tbl_lnkServicetemplateToServicetemplate  OK
nagiosSQL.tbl_lnkServicetemplateToVariabledefinition OK
nagiosSQL.tbl_lnkTimeperiodToTimeperiod            OK
nagiosSQL.tbl_logbook                              OK
nagiosSQL.tbl_mainmenu                             OK
nagiosSQL.tbl_permission                           OK
nagiosSQL.tbl_permission_inactive                  OK
nagiosSQL.tbl_service                              OK
nagiosSQL.tbl_servicedependency                    OK
nagiosSQL.tbl_serviceescalation                    OK
nagiosSQL.tbl_serviceextinfo                       OK
nagiosSQL.tbl_servicegroup                         OK
nagiosSQL.tbl_servicetemplate                      OK
nagiosSQL.tbl_session                              OK
nagiosSQL.tbl_session_locks                        OK
nagiosSQL.tbl_settings                             OK
nagiosSQL.tbl_submenu                              OK
nagiosSQL.tbl_timedefinition                       OK
nagiosSQL.tbl_timeperiod                           OK
nagiosSQL.tbl_user                                 OK
nagiosSQL.tbl_variabledefinition                   OK

ssax wrote:Try running this command to clear out some temporary tables to see if that alleviates it:
- You can get the X.X.X.X/user/pass from /usr/local/nagiosxi/html/config.inc.php

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -h X.X.X.X -uyourusername -p'yourpassword' nagiosXI
Those temp tables are too small. Does those tables affect to the performance of ndo2db inserting data in nagios database?
ssax wrote:If that doesn't, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/

Thank you!
I will open a ticket.

Thank you very much for your time, patience and effort.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Differences/delay last update and last check

Post by vtrac »

Support ticket opened:
https://support.nagios.com/tickets/scp/ ... p?id=13867

Locking thread!!
Locked