Backup of the Nagios Core
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Backup of the Nagios Core
How to take the backup of the Nagios Core?
Is there any script with which i can take the backup of the Nagios?
Please suggest.
Is there any script with which i can take the backup of the Nagios?
Please suggest.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Backup of the Nagios Core
Hello, @amitgupta19. I believe Nagios Core does not have a sophisticated backup solution like Nagios XI. You may find a custom script on the internet that does it. However, usually it all comes down to backing up the/usr/local/nagios/etc folder. That's where all the main configs are stored. You may use FileZilla or WinSCP to download the whole folder. If you're running nagios Core on a Virtual machine, then making a snapshot would be an ideal solution.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Backup of the Nagios Core
What I do is I mount an external drive using 7zip. normal zip doesn't do a super great job of getting all the files.
My nagios is on Ubuntu not CentOS so ur commands might vary slightly.
If u don't have 7zip install then install it
then plugin in your ext drive and find the ext drive once u plugged in it by typing:
Returns something like this
Mount the drive
then I run this command to back it up using 7zip
The code above assumes you have mounted a ext drive to /media/bkup/ and will backup /usr/local/nagios folder to it.
The finished files look something like this.. "nagios.2017-12-06.7z"
I used to use a normal zip command but it had a problem where it couldn't always backup all the config files.
My nagios is on Ubuntu not CentOS so ur commands might vary slightly.
If u don't have 7zip install then install it
Code: Select all
sudo apt-get install p7zip-full
Code: Select all
fdisk -l
Code: Select all
Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 1465144064 1465144002 698.7G 7 HPFS/NTFS/exFAT
Code: Select all
mount /dev/sdb1 /media/bkup
Code: Select all
7z a -t7z "/media/bkup/nagios.$(date +"%F").7z" /usr/local/nagios
The finished files look something like this.. "nagios.2017-12-06.7z"
I used to use a normal zip command but it had a problem where it couldn't always backup all the config files.
Last edited by t3dus on Sat Dec 09, 2017 6:48 pm, edited 1 time in total.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Backup of the Nagios Core
@t3dus, Thanks for sharing your recommendation!
@amitgupta19, Please let us know if you have any other questions related to this topic.
@amitgupta19, Please let us know if you have any other questions related to this topic.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Backup of the Nagios Core
I am just copying the files from the folder where all the configuration files are located.
I hope that it is ok, at the time of restoring this should work?
I hope that it is ok, at the time of restoring this should work?
Re: Backup of the Nagios Core
As long as you backup "/usr/local/nagios" and all the directories after that that then that will contain all the Nagios config files needed for restore provided that you did the default install and didn't install to a separate location.
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Backup of the Nagios Core
In the /usr/local/nagios i can see the following 2 Folders: Refer to the screenshot(Backup)
and i am taking the backup of the folder: Refer to the screenshot attached(Backup-1)
How to ensure that installation has been done without changing the default location? Because i didn't installed the Nagios and i am also new to Nagios.
and i am taking the backup of the folder: Refer to the screenshot attached(Backup-1)
How to ensure that installation has been done without changing the default location? Because i didn't installed the Nagios and i am also new to Nagios.
Re: Backup of the Nagios Core
What Nagios Version are you running? My guess is version 3?
Looks like yours may be installed a bit differently than the version I run which is 4.3.4.
Your config files are under /etc/nagios while mine are under /usr/local/nagios
This is what I see under my folder /usr/local/nagios
My main config files exist under the folder called "etc" and my host objects are in a folder under that called "objects"
Looks like yours may be installed a bit differently than the version I run which is 4.3.4.
Your config files are under /etc/nagios while mine are under /usr/local/nagios
This is what I see under my folder /usr/local/nagios
Code: Select all
# /usr/local/nagios# ls -1
bin
etc
include
libexec
sbin
share
var
Code: Select all
/usr/local/nagios# :/usr/local/nagios# ls -1 etc
cgi.cfg
htpasswd.users
nagios.cfg
objects
resource.cfg
Last edited by t3dus on Tue Mar 06, 2018 4:28 pm, edited 1 time in total.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Backup of the Nagios Core
@amitgupta19, Looks like the main folder with all the configs on your system is /etc/nagios/. Have you considered spinning up Nagios Core on a Virtual machine? That way you could make system snapshots and revert any time.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Backup of the Nagios Core
@t3dus: Version of the Nagios Core that i am using is 3.3.1
Does it makes sense to keep a copy of the configuration files , in my case. So that i can restore the backup at any point of time.
@npolovenko: Currently nagios Core is running on the Physical machine.
Does it makes sense to keep a copy of the configuration files , in my case. So that i can restore the backup at any point of time.
@npolovenko: Currently nagios Core is running on the Physical machine.