Page 1 of 1
Nagios Core 3.2.3 to the latest one
Posted: Mon Nov 11, 2024 4:25 am
by maxfactor
Hello, good day to everyone!
I would like to update my old Nagios but I realize that the leap could lead to configuration issues.
How could I "backup" my whole Nagios installation&configuration so that if something goes wrong with the update I can fully roll back to the previous state?
Re: Nagios Core 3.2.3 to the latest one
Posted: Mon Nov 11, 2024 10:12 am
by lgute
Hi
@maxfactor,
Thanks for reaching out.
If Nagios Core is running on a VM, the simplest thing to do is create a snapshot, before you perform the upgrade.
If not, you would want to take the following steps. Please test that this process works, preferably in a sandbox/test box/vm, before relying on it for an upgrade.
- Backup Configuration Files
Nagios Core configuration files are historically located in /usr/local/nagios/etc/ or /etc/nagios/. Backup the entire directory to make sure you have all custom configurations, host definitions, service definitions, and other settings.
tar -czvf nagios_backup.tar.gz /usr/local/nagios/etc/
----
- Backup the Nagios Database (if you are using a SQL database)
If you are using a database (like MySQL or PostgreSQL) for storing performance data, back it up.
MySQL:
mysqldump -u username -p nagios_db > nagios_db_backup.sql
----
- Backup Plugins and Additional Files
There may be custom plugins or scripts, usually located in /usr/local/nagios/libexec/ or they might be in a custom directory you or a co-worker set up.
tar -czvf nagios_plugins_backup.tar.gz /usr/local/nagios/libexec/
----
If you have any customizations to the web interface or if you have modifications to the web server configuration, make sure you back up those files.
Whatever you end up with, put in a shell script and schedule it to run daily or whatever you are comfortable with, so you can restore if you ever have a catastrophic situation.