Page 1 of 2

Nagios XI Dashboards Disappeared

Posted: Tue Sep 06, 2016 4:06 pm
by ckiernan
I was configuring a couple of dashboards in the admin account that were meant to be deployed to other users. After adding a Multistacked Performance Graph all my Dashboards vanished. If I login as other users it appears this is only affecting the admin account at the moment. I see a couple of older threads that appear to be the same problem, but I'm not clear on what the solution is.

I'm running Nagios XI version 5.2.5 on Centos 7 with MariaDB running on an external server.

I have a tangentially related question about running a database repair on an external database. I just ran repair_databases.sh on my Nagios server but it appears to have run against the old local database instead of the external DB I offloaded to months ago. How am I meant to run a repair in this case?

Thanks,

Chris

Re: Nagios XI Dashboards Disappeared

Posted: Wed Sep 07, 2016 11:05 am
by tgriep
Lets try and do a repair if the mysql database and restart the nagios and the apache process and see if that helps.
Login as root to the XI server and run the following to do that.

Code: Select all

mysqlcheck -f -r -u root -pnagiosxi --all-databases -h xxx.xxx.xxx.xxx
service nagios restart
service httpd restart
Replace xxx.xxx.xxx.xxx with the IP address of the mysql server.

If it fails, run the following on the XI server and post it here.

Code: Select all

grep dbtype /usr/local/nagiosxi/html/config.inc.php
Have you tried and clear out the browser cache or tried a different browser to see if it fails as well?

Re: Nagios XI Dashboards Disappeared

Posted: Wed Sep 07, 2016 2:27 pm
by ckiernan
No change. I did try clearing browser cache and trying for other browsers/devices.

Here is the output of mysqlcheck.

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

The other information you requested....

[root@nm etc]# grep dbtype /usr/local/nagiosxi/html/config.inc.php
$cfg['dbtype'] = ''; // this setting is no longer used - use settings below
"dbtype" => 'mysql',
"dbtype" => 'mysql',
"dbtype" => 'mysql',

Re: Nagios XI Dashboards Disappeared

Posted: Wed Sep 07, 2016 2:48 pm
by tgriep
The output of the mysqlcheck does not show the other 2 databases (nagiosxi and nagiosql).
Did you just offload the nagios database and not the other 2?
If so, run this as root on the XI server and post the output.

Code: Select all

mysqlcheck -f -r -u root -pnagiosxi --all-databases

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 6:35 am
by ckiernan
In error, I used an account other than root to run the repair. I ran it again as root, restarted nagios, still no change.

[root@nm ~]# mysqlcheck -f -r -u root -pxxxxxxx --all-databases -h xxx.xx.xx.xxx
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
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
nagiosql.tbl_command OK
nagiosql.tbl_contact OK
nagiosql.tbl_contactgroup OK
nagiosql.tbl_contacttemplate OK
nagiosql.tbl_domain OK
nagiosql.tbl_host OK
nagiosql.tbl_hostdependency OK
nagiosql.tbl_hostescalation OK
nagiosql.tbl_hostextinfo OK
nagiosql.tbl_hostgroup OK
nagiosql.tbl_hosttemplate OK
nagiosql.tbl_info OK
nagiosql.tbl_lnkContactToCommandHost OK
nagiosql.tbl_lnkContactToCommandService OK
nagiosql.tbl_lnkContactToContactgroup OK
nagiosql.tbl_lnkContactToContacttemplate OK
nagiosql.tbl_lnkContactToVariabledefinition OK
nagiosql.tbl_lnkContactgroupToContact OK
nagiosql.tbl_lnkContactgroupToContactgroup OK
nagiosql.tbl_lnkContacttemplateToCommandHost OK
nagiosql.tbl_lnkContacttemplateToCommandService OK
nagiosql.tbl_lnkContacttemplateToContactgroup OK
nagiosql.tbl_lnkContacttemplateToContacttemplate OK
nagiosql.tbl_lnkContacttemplateToVariabledefinition OK
nagiosql.tbl_lnkHostToContact OK
nagiosql.tbl_lnkHostToContactgroup OK
nagiosql.tbl_lnkHostToHost OK
nagiosql.tbl_lnkHostToHostgroup OK
nagiosql.tbl_lnkHostToHosttemplate OK
nagiosql.tbl_lnkHostToVariabledefinition OK
nagiosql.tbl_lnkHostdependencyToHost_DH OK
nagiosql.tbl_lnkHostdependencyToHost_H OK
nagiosql.tbl_lnkHostdependencyToHostgroup_DH OK
nagiosql.tbl_lnkHostdependencyToHostgroup_H OK
nagiosql.tbl_lnkHostescalationToContact OK
nagiosql.tbl_lnkHostescalationToContactgroup OK
nagiosql.tbl_lnkHostescalationToHost OK
nagiosql.tbl_lnkHostescalationToHostgroup OK
nagiosql.tbl_lnkHostgroupToHost OK
nagiosql.tbl_lnkHostgroupToHostgroup OK
nagiosql.tbl_lnkHosttemplateToContact OK
nagiosql.tbl_lnkHosttemplateToContactgroup OK
nagiosql.tbl_lnkHosttemplateToHost OK
nagiosql.tbl_lnkHosttemplateToHostgroup OK
nagiosql.tbl_lnkHosttemplateToHosttemplate OK
nagiosql.tbl_lnkHosttemplateToVariabledefinition OK
nagiosql.tbl_lnkServiceToContact OK
nagiosql.tbl_lnkServiceToContactgroup OK
nagiosql.tbl_lnkServiceToHost OK
nagiosql.tbl_lnkServiceToHostgroup OK
nagiosql.tbl_lnkServiceToServicegroup OK
nagiosql.tbl_lnkServiceToServicetemplate OK
nagiosql.tbl_lnkServiceToVariabledefinition OK
nagiosql.tbl_lnkServicedependencyToHost_DH OK
nagiosql.tbl_lnkServicedependencyToHost_H OK
nagiosql.tbl_lnkServicedependencyToHostgroup_DH OK
nagiosql.tbl_lnkServicedependencyToHostgroup_H OK
nagiosql.tbl_lnkServicedependencyToService_DS OK
nagiosql.tbl_lnkServicedependencyToService_S OK
nagiosql.tbl_lnkServiceescalationToContact OK
nagiosql.tbl_lnkServiceescalationToContactgroup OK
nagiosql.tbl_lnkServiceescalationToHost OK
nagiosql.tbl_lnkServiceescalationToHostgroup OK
nagiosql.tbl_lnkServiceescalationToService OK
nagiosql.tbl_lnkServicegroupToService OK
nagiosql.tbl_lnkServicegroupToServicegroup OK
nagiosql.tbl_lnkServicetemplateToContact OK
nagiosql.tbl_lnkServicetemplateToContactgroup OK
nagiosql.tbl_lnkServicetemplateToHost OK
nagiosql.tbl_lnkServicetemplateToHostgroup OK
nagiosql.tbl_lnkServicetemplateToServicegroup OK
nagiosql.tbl_lnkServicetemplateToServicetemplate OK
nagiosql.tbl_lnkServicetemplateToVariabledefinition OK
nagiosql.tbl_lnkTimeperiodToTimeperiod OK
nagiosql.tbl_logbook OK
nagiosql.tbl_mainmenu OK
nagiosql.tbl_service OK
nagiosql.tbl_servicedependency OK
nagiosql.tbl_serviceescalation OK
nagiosql.tbl_serviceextinfo OK
nagiosql.tbl_servicegroup OK
nagiosql.tbl_servicetemplate OK
nagiosql.tbl_settings OK
nagiosql.tbl_submenu OK
nagiosql.tbl_timedefinition OK
nagiosql.tbl_timeperiod OK
nagiosql.tbl_user OK
nagiosql.tbl_variabledefinition OK
nagiosxi.xi_auditlog
note : The storage engine for the table doesn't support repair
nagiosxi.xi_commands
note : The storage engine for the table doesn't support repair
nagiosxi.xi_events
note : The storage engine for the table doesn't support repair
nagiosxi.xi_incidents
note : The storage engine for the table doesn't support repair
nagiosxi.xi_meta
note : The storage engine for the table doesn't support repair
nagiosxi.xi_options
note : The storage engine for the table doesn't support repair
nagiosxi.xi_sysstat
note : The storage engine for the table doesn't support repair
nagiosxi.xi_usermeta
note : The storage engine for the table doesn't support repair
nagiosxi.xi_users
note : The storage engine for the table doesn't support repair

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 9:11 am
by ssax
It's likely related to a bug with the field size, please run this command to change the field size:
- Note: Since you are doing DB alterations, please make sure you have an XI/VM backup just in case. This should not have any impact on existing data.

Code: Select all

echo "alter table xi_usermeta modify keyvalue MEDIUMTEXT;" | mysql -uroot -pnagiosxi nagiosxi
Then find the user_id for the user that is currently having the problem:

Code: Select all

echo "select user_id, username from xi_users;" | mysql -t -uroot -pnagiosxi nagiosxi
Then delete the corrupted data that they have in the table for the dashboards:
- Change THEUSERID to the user_id from the above output.

Code: Select all

echo "delete from xi_usermeta where user_id = 'THEUSERID' and keyname = 'dashboards';" | mysql -uroot -pnagiosxi nagiosxi
Then logout and login again and recreate the dashboards for that user.


Thank you

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 9:21 am
by ckiernan
I see. I will do this but I'd like to know if this will impact Dashboards I've deployed to other users - in particular dashboards that are kept in sync with mine.

Thanks.

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 11:16 am
by ssax
That's a good question, it likely will, please PM me the resulting /tmp/xi_usermeta.sql file from this command:

Code: Select all

mysqldump -uroot -pnagiosxi nagiosxi xi_usermeta > /tmp/xi_usermeta.sql
Also, please send me the affected user_id from the output of this command so that I can try to fix it instead of deleting what you have currently in there:

Code: Select all

echo "select user_id, username from xi_users;" | mysql -t -uroot -pnagiosxi nagiosxi
Thank you

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 1:27 pm
by ckiernan
I sent you the info. It would be tremendous is you could find a solution without me having to start over. That's days of work for me and some unhappy customers.

Thanks for your help.

Re: Nagios XI Dashboards Disappeared

Posted: Thu Sep 08, 2016 4:52 pm
by ssax
The data doesn't contain anything other than the default for the nagiosadmin user, do you have a backup we could pull it from?

First and foremost, run this command to expand the field, it's safe, we don't want anyone else running into it:

Code: Select all

echo "alter table xi_usermeta modify keyvalue MEDIUMTEXT;" | mysql -uroot -pnagiosxi nagiosxi