Page 1 of 1

RESOLVED: How to change folder for manual backup Nagios XI

Posted: Wed Oct 02, 2024 3:37 am
by speynaud
Hi Team,
I have an issue on my Nagios XI 2024R1.2.2 on VM RHEL9 on GCP.

I added another disk on my VM for backups and I wanted to change path original backup path (/store/backups/nagiosxi) to a new path on my new drive (/var/backup-data/store/backups/nagiosxi).

Scheduled backup working fine (setup directly with nagios XI webui)

Manual backup working fine (change directory in file /usr/local/nagiosxi/scripts/backup_xi.sh)

But in the nagios xi webui "Local Backup Archives" I can see only original path "/store/backups/nagiosxi"

Do you know where is the setup file for this parameter?

Thank you by advance

Re: How to change folder for manual backup Nagios XI

Posted: Wed Oct 02, 2024 9:51 am
by sgardil
speynaud wrote: Wed Oct 02, 2024 3:37 am Hi Team,
I have an issue on my Nagios XI 2024R1.2.2 on VM RHEL9 on GCP.

I added another disk on my VM for backups and I wanted to change path original backup path (/store/backups/nagiosxi) to a new path on my new drive (/var/backup-data/store/backups/nagiosxi).

Scheduled backup working fine (setup directly with nagios XI webui)

Manual backup working fine (change directory in file /usr/local/nagiosxi/scripts/backup_xi.sh)

But in the nagios xi webui "Local Backup Archives" I can see only original path "/store/backups/nagiosxi"

Do you know where is the setup file for this parameter?

Thank you by advance
Hey @speynaud thanks for reaching out.

Unfortunately for the time being it looks like there isn't a way to change this in our system without manually changing the code. If you are comfortable you can make code changes to localbackups.php to change the $backup_dir to match where you want the new location, however I will make a feature request to add the ability to change our backup location for local archives. We can't give any dates for when this will be implemented but you can keep an eye on our changelog for any changes we make.

Re: How to change folder for manual backup Nagios XI

Posted: Wed Oct 02, 2024 9:57 am
by lgute
Hi @speynaud, thanks for reaching out.

Unfortunately, the directory is hard coded in several places, for the Local Backup Archives page.

I was going to create an Issue for this, but Sandor beat me to it.

In the meantime, you can edit /usr/local/nagiosxi/html/includes/components/scheduledbackups/localbackups.php and replace /store/backups/nagiosxi with the appropriate directory. Looks like there are 4 locations. So after your edits, the lines should look like this (the line numbers should be pretty close).

Code: Select all

#56     $backup_dir = "/var/backup-data/store/backups/nagiosxi";
#70             "size" => sb_human_filesize(filesize("/var/backup-data/store/backups/nagiosxi/" . $name . ".tar.gz")),
#108    $thefile = '/var/backup-data/store/backups/nagiosxi/' . $ts . ".tar.gz";
#196    <p class="neptune-subtext"><?php echo _('Current backup files in /var/backup-data/store/backups/nagiosxi.'); ?></p>
Note that you will need to make these changes after upgrades, until we get an enhancement out.

Re: How to change folder for manual backup Nagios XI

Posted: Thu Oct 03, 2024 4:50 am
by speynaud
Thank you so much for your answer.

Laura, I tried to open php file, but it seems to be crypted because I have only one code line which is VERY VERY VERY .... VERY VERY long.

Please have a look on my attached screenshot.

If I have a good understanding, you will include this fucntion in your next release?

Re: How to change folder for manual backup Nagios XI

Posted: Thu Oct 03, 2024 9:49 am
by lgute
Hi @speynaud,

Unfortunate, but perhaps this may work better. Move the old backups directory and create a symbolic link.

Code: Select all

mv /store/backups/nagiosxi /store/backups/nagiosxi-bak
ln -s /var/backup-data/store/backups/nagiosxi /store/backups/nagiosxi
chown -R nagios:nagios /store/backups/nagiosxi
You can check for enhanced functionality of the Local Backup Archives page in the CHANGELOG, listed as [GL:XI#1323].

Re: How to change folder for manual backup Nagios XI

Posted: Fri Oct 04, 2024 1:58 am
by speynaud
Great very good idea, that's working fine with symbolic link.

Thank you so much

Re: How to change folder for manual backup Nagios XI

Posted: Fri Oct 04, 2024 9:32 am
by lgute
Hi @speynaud,

Thanks for letting us know the symbolic link is working for you. I am going to close this thread.