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
RESOLVED: How to change folder for manual backup Nagios xi
-
- Posts: 14
- Joined: Mon Jul 31, 2023 2:56 am
RESOLVED: How to change folder for manual backup Nagios xi
You do not have the required permissions to view the files attached to this post.
-
- Posts: 327
- Joined: Wed Aug 09, 2023 9:58 am
Re: How to change folder for manual backup Nagios xi
Hey @speynaud thanks for reaching out.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
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.
-
- Posts: 318
- Joined: Mon Apr 06, 2020 2:49 pm
Re: How to change folder for manual backup Nagios xi
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).
Note that you will need to make these changes after upgrades, until we get an enhancement 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>
Please let us know if you have any other questions or concerns.
-Laura
-Laura
-
- Posts: 14
- Joined: Mon Jul 31, 2023 2:56 am
Re: How to change folder for manual backup Nagios xi
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?
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.
-
- Posts: 318
- Joined: Mon Apr 06, 2020 2:49 pm
Re: How to change folder for manual backup Nagios xi
Hi @speynaud,
Unfortunate, but perhaps this may work better. Move the old backups directory and create a symbolic link.
You can check for enhanced functionality of the Local Backup Archives page in the CHANGELOG, listed as [GL:xi#1323].
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
Please let us know if you have any other questions or concerns.
-Laura
-Laura
-
- Posts: 14
- Joined: Mon Jul 31, 2023 2:56 am
Re: How to change folder for manual backup Nagios xi
Great very good idea, that's working fine with symbolic link.
Thank you so much
Thank you so much
-
- Posts: 318
- Joined: Mon Apr 06, 2020 2:49 pm
Re: How to change folder for manual backup Nagios xi
Hi @speynaud,
Thanks for letting us know the symbolic link is working for you. I am going to close this thread.
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
-Laura