User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

nconf_deployer [2011/09/28 13:23] (current)
k2patel created
Line 1: Line 1:
 +====== NConf Deployer ======
 +nconf nice nagios configurator works awesome but i had issue with the addon script.\\
 +So i have modified to work in my environment it's not special but it working since i deployed without any issue.\\
 +I also added to keep Backup of previous working nagios configuration.\\
 +Please make sure all directory writable to script owner.\\
 +i run this script in cron every Minute.\\
 +It only execute if there is change so should be good.
 +<code bash |>​
 +## Original Script taken from source of Nconf.
 +## Updated by [email protected]
 +OUTPUT_DIR="​​output/" ​                ## This is where it stores the output
 +NAGIOS_DIR="/​etc/​nagios/" ​                       ## Location for Nagios
 +TEMP_DIR=${NAGIOS_DIR}"​import/" ​                 ## this is where it move files from output
 +CONF_ARCHIVE="​NagiosConfig.tgz" ​                 ## Archive Name
 +BK_UP_DIR=${NAGIOS_DIR}"​0ld_backup/" ​            ## Backup which keep previous working configuration just incase
 +if [ ! -e ${TEMP_DIR} ] ; then
 +mkdir -p ${TEMP_DIR}
 +if [ ! -e ${BK_UP_DIR} ] ; then
 +mkdir -p ${BK_UP_DIR}
 +rm -rf ${BK_UP_DIR}/​Default_collector ${BK_UP_DIR}/​global ${BK_UP_DIR}/​static_cfg
 +mv -f ${NAGIOS_DIR}/​Default_collector ${BK_UP_DIR}/​
 +mv -f ${NAGIOS_DIR}/​global ${BK_UP_DIR}/​
 +mv -f ${NAGIOS_DIR}/​static_cfg ${BK_UP_DIR}/ ​
 +/​etc/​init.d/​nagios reload
nconf_deployer.txt ยท Last modified: 2011/09/28 13:23 by k2patel