v5.4.0 upd error: Error backing up MySQL database 'nagios'

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gpi
Posts: 23
Joined: Thu Dec 11, 2014 4:03 am

v5.4.0 upd error: Error backing up MySQL database 'nagios'

Post by gpi »

Errors when trying to update from nagiosxi v5.3.4 to v5.4.0:

---- Starting Nagios XI Backup ----
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'snmp' already loaded in Unknown on line 0
No entry for terminal type "unknown";
using dumb terminal settings.
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/share/perfdata/sitesphp.cen.intranet/_HOST_.rrd: file changed as we read it
tar: /usr/local/nagios/share/perfdata/sitesphp.cen.intranet: file changed as we read it
tar: /usr/local/nagios/share/perfdata/wcsdlv1.tic1.intranet: file changed as we read it
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got errno 28 on write
Error backing up MySQL database 'nagios' - check the password in this script!

To my knowledge this password hasn't changed and all previous updates/upgrades worked seamlessly.

The final recomendation from the upgrade option is:

The update did not complete successfully. Please try updating manually.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by rkennedy »

Please run the following commands to verify the default credentials -

Code: Select all

mysql -uroot -pnagiosxi
mysql -unagiosxi -pn@gweb
mysql -undoutils -pn@gweb
If any of those fail, then see this doc for what needs to be updated - https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios Employee
gpi
Posts: 23
Joined: Thu Dec 11, 2014 4:03 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by gpi »

Thanks,

The result is OK for root & ndoutils, but not for nagiosxi:

[root@nagiosxi ~]# mysql -unagiosxi -pn@gweb
ERROR 1045 (28000): Access denied for user 'nagiosxi'@'localhost' (using password: YES)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by rkennedy »

You'll want to make sure the nagiosxi user's password has been updated in all places. Take a look at https://assets.nagios.com/downloads/nag ... ios-XI.pdf specifically under the 'NAGIOSXI' part -
Former Nagios Employee
gpi
Posts: 23
Joined: Thu Dec 11, 2014 4:03 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by gpi »

Hi.

User nagiosxi does not exist:

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> set password for 'nagiosxi'@localhost= password('MyPass);
ERROR 1133 (42000): Can't find any matching row in the user table

thanks
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by SteveBeauchemin »

in MySQL

try this
GRANT ALL ON nagiosxi.* TO nagiosxi@'localhost' IDENTIFIED BY 'nagiosxi';

where
nagiosxi.* is the nagiosxi database
nagiosxi@localhost is the user
BY 'nagiosxi' is the password.
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by dwhitfield »

Thanks again @SteveBeauchemin!

@gpi, does that get you up and running?
gpi
Posts: 23
Joined: Thu Dec 11, 2014 4:03 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by gpi »

Thanks a bunch Mr Whitfield!!!

Solution:

Code: Select all

[root@nagiosxi ~]# mysql -uroot -pnagiosxi
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 416474
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL ON nagiosxi.* TO nagiosxi@'localhost' IDENTIFIED BY 'n@gweb';
Query OK, 0 rows affected (0.08 sec)

mysql>
And Upgrade Re-Run:

Code: Select all

---- Starting Nagios XI Backup ----
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
No entry for terminal type "unknown";
using dumb terminal settings.
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/share/perfdata/bsf.bsf.intranet: file changed as we read it
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...

gzip: stdout: No space left on device
 
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/autoupgrade_backup.1484124119.tar.gz

---- Starting Nagios XI Upgrade ----
Cleaning up temp directory...
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
No entry for terminal type "unknown";
using dumb terminal settings.
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
No entry for terminal type "unknown";
using dumb terminal settings.
...
...
WRITE CONFIGS SUCCESSFUL!
OUTPUT: 
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Warning: Duplicate definition found for service 'Control de login a instancias DB Oracle' on host 'bd_jmnh' (config file '/usr/local/nagios/etc/services/Oracle_DB_Login.cfg', starting on line 16)
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
	Checked 801 services.
	Checked 477 hosts.
	Checked 37 host groups.
	Checked 2 service groups.
	Checked 22 contacts.
	Checked 4 contact groups.
	Checked 199 commands.
	Checked 27 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 477 hosts
	Checked 0 service dependencies
	Checked 22 host dependencies
	Checked 27 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Fixing php-mcrypt bug...
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
No entry for terminal type "unknown";
using dumb terminal settings.

Nagios XI Upgrade Complete!
---------------------------
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: v5.4.0 upd error: Error backing up MySQL database 'nagio

Post by tgriep »

I saw a No space left on device message when you ran the upgrade.
I would assume that the hard drive is full and that is causing the error.
Run the following as root to determine if the drive is full. Post the output.

Code: Select all

df -h
df -i
If the drive is full, you can follow the guide below to resize the drive if Nagios XI is running on a VMWare server.
https://assets.nagios.com/downloads/nag ... M-Disk.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked