Backing Up Nagios Core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
joe1871
Posts: 28
Joined: Tue Feb 01, 2011 3:36 pm

Backing Up Nagios Core

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Backing Up Nagios Core

Post 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.
Locked