RESOLVED: How to change folder for manual backup Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
speynaud
Posts: 14
Joined: Mon Jul 31, 2023 2:56 am

RESOLVED: How to change folder for manual backup Nagios XI

Post 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
You do not have the required permissions to view the files attached to this post.
sgardil
Posts: 327
Joined: Wed Aug 09, 2023 9:58 am

Re: How to change folder for manual backup Nagios XI

Post 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.
User avatar
lgute
Posts: 318
Joined: Mon Apr 06, 2020 2:49 pm

Re: How to change folder for manual backup Nagios XI

Post 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.
Please let us know if you have any other questions or concerns.

-Laura
speynaud
Posts: 14
Joined: Mon Jul 31, 2023 2:56 am

Re: How to change folder for manual backup Nagios XI

Post 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?
You do not have the required permissions to view the files attached to this post.
User avatar
lgute
Posts: 318
Joined: Mon Apr 06, 2020 2:49 pm

Re: How to change folder for manual backup Nagios XI

Post 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].
Please let us know if you have any other questions or concerns.

-Laura
speynaud
Posts: 14
Joined: Mon Jul 31, 2023 2:56 am

Re: How to change folder for manual backup Nagios XI

Post by speynaud »

Great very good idea, that's working fine with symbolic link.

Thank you so much
User avatar
lgute
Posts: 318
Joined: Mon Apr 06, 2020 2:49 pm

Re: How to change folder for manual backup Nagios XI

Post by lgute »

Hi @speynaud,

Thanks for letting us know the symbolic link is working for you. I am going to close this thread.
Please let us know if you have any other questions or concerns.

-Laura
Locked