Page 1 of 1

Backing Up Nagios Core

Posted: Mon Oct 31, 2011 4:15 pm
by joe1871
I would like to run a scripted backup of Nagios Core. I have a pretty significant implementation of Nagios and right now I am manually backing up several key directories. I would be interested in a list of the necessary files to properly backup and then restore.

One of my concerns are the state files. If my server should go down and my most current backup is several days old what happens if I restore with those older files? Is there logic that says back up the state files very often? Which files are important to back up? If I was going to write a backup shell script that copied all files in the ../nagios/etc. ../nagios/libexec, nagios/var, and in my case the /usr/lib/nagios/plugins (I know it the wrong location but I have some working files there and don't want to move them...) would that get everythng? Is there any other Nagios set of files that I need to grab?

Thanks in advance

Also -for restoring - anything besides restoring all of the files and then running the config checker?

Joe

Re: Backing Up Nagios Core

Posted: Tue Nov 01, 2011 1:11 pm
by mguthrie
You've got most of the necessary files. It might be worth knowing:

nagios/etc -> All of your object configs. Be sure to back these up.
nagios/var/retention.dat -> This retains the last few states for all hosts and services, as well as preserving the check schedule.
nagios/var/status.dat ->volatile file that gets recreated everytime nagios restarts
nagios/var/objects.cache ->volatile file that gets recreated everytime nagios restarts
nagios/var/nagios.log
nagios/var/archives -> log file + archives are parsed to produce availability reports.