Local Backup is not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
11abbidoa
Posts: 21
Joined: Wed May 08, 2024 2:03 am

Local Backup is not working

Post by 11abbidoa »

When I tried to capture local backup from Web UI > Admin > System Backups > Local Backup Archives.
It says successful but nothing shows up even after refresh.
Also checked the local path and no files can be seen.

I ran this command and this is what I got. Any help please.
[root@NagiosServer nagiosxi]# tail -100 /usr/local/nagiosxi/var/components/scheduledbackups.log
Error backing up MySQL database 'nagios' - check the password in this script!
Error backing up MySQL database 'nagios' - check the password in this script!
Error backing up MySQL database 'nagios' - check the password in this script!
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Local Backup is not working

Post by gwesterman »

Hi @11abbidoa,

Try the following:

1. Run this script to get your database passwords (if you do not have this script, let me know - you are probably on a version of XI that is too old):

Code: Select all

/usr/local/nagiosxi/scripts/get_mysql_passwords.sh
2. Make sure these passwords work. Namely, try to login to your mysql database using these passwords.
3. Make sure these passwords match the passwords in /usr/local/nagiosxi/html/config.inc.php.

Once you verify the passwords work and match, try generating a local backup. If anything goes awry in this process, let us know.

Thank you!
11abbidoa
Posts: 21
Joined: Wed May 08, 2024 2:03 am

Re: Local Backup is not working

Post by 11abbidoa »

gwesterman wrote: Fri Sep 27, 2024 12:14 pm
1. Run this script to get your database passwords (if you do not have this script, let me know - you are probably on a version of XI that is too old):

Code: Select all

/usr/local/nagiosxi/scripts/get_mysql_passwords.sh
I checked the local path and cant find the script. Can you send the script please. Thanks.
gwesterman wrote: Fri Sep 27, 2024 12:14 pm
2. Make sure these passwords work. Namely, try to login to your mysql database using these passwords.
Apologies, can you tell me how should I do this. Sorry, the person who built our Nagios have left the company
sgardil
Posts: 349
Joined: Wed Aug 09, 2023 9:58 am

Re: Local Backup is not working

Post by sgardil »

11abbidoa wrote: Tue Oct 01, 2024 6:58 am
gwesterman wrote: Fri Sep 27, 2024 12:14 pm
1. Run this script to get your database passwords (if you do not have this script, let me know - you are probably on a version of XI that is too old):

Code: Select all

/usr/local/nagiosxi/scripts/get_mysql_passwords.sh
I checked the local path and cant find the script. Can you send the script please. Thanks.
gwesterman wrote: Fri Sep 27, 2024 12:14 pm
2. Make sure these passwords work. Namely, try to login to your mysql database using these passwords.
Apologies, can you tell me how should I do this. Sorry, the person who built our Nagios have left the company
I'll have to take a look more into the backup process to get a better ideal why this is failing but assuming you are running the back up on your cent 7 server that was on 5.9.1, that script wont exists yet. That script was made in an update where we have the user set their password or have it be randomized for the db logins to be more secure. I believe the password used to be just nagiosxi. You can try to login via the cli by running

Code: Select all

mysql -u root -p
followed by the password.
11abbidoa
Posts: 21
Joined: Wed May 08, 2024 2:03 am

Re: Local Backup is not working

Post by 11abbidoa »

sgardil wrote: Tue Oct 01, 2024 9:39 am

Code: Select all

mysql -u root -p
followed by the password.
yes it works..

When I checked:
cat /usr/local/nagiosxi/html/config.inc.php
This is what I get.
"user" => 'nagiosxi',
"pwd" => 'n@gweb',
"db" => 'nagiosxi',

Aand I managed to login to db using this account too. So what is this mean?
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Local Backup is not working

Post by gwesterman »

Are you able to login to your 'nagios' database using the password in config.inc.php? You can find the database name, user, and password under the "ndoutils" section (where it has "db => 'nagios').
Post Reply