Whats the best way to verify temporary configs?

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
skol
Posts: 29
Joined: Mon Jan 28, 2013 3:56 pm

Whats the best way to verify temporary configs?

Post by skol »

Hey guys,

I have a process which drops newly generated configs on a nagios box, but I want to verify them before copying them over and restarting. I figured copying them to /tmp/configs/$date/nagios.cfg then running nagios -v /tmp/configs/$date/nagios.cfg would do the trick.. but that doesn't work - it just verifies the current running configs (Due to paths inside nagios.cfg the same as the currently running install). Is there a way to run a self contained syntax verify on a set of configs?

Thanks!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Whats the best way to verify temporary configs?

Post by tmcdonald »

Copy the nagios.cfg and edit the paths to point to the temp files, then just run nagios -v against this new config file.
Former Nagios employee
Locked