move to the /var/www directory
cd /var/www
wget http://sourceforge.net/projects/nconf/files/nconf/1.3.0-0/nconf-1.3.0-0.tgz
tar zxvf nconf-1.3.0-0.tgz
cd /var/www/nconf
chmod 777 config/
chmod 777 output/
chmod 777 static_cfg/
chmod 777 temp/
now from your browser type:
http://ip_address/nconf
Nconf Path: /var/www/nconf
Nagios path: /usr/local/nagios/bin/nagios

for greater security enable auth_enabled and enter a password.

Before clicking finish delete the following files:
rm -rf INSTALL
rm -rf UPDATE
rm INSTALL.php
rm UPDATE.php
now all that remains is to click finish and enter username and password
username: admin password: the one you chose
Bug: nconf also has a bug. To resurrect it from this website, download the patch:
http://forum.nconf.org/viewtopic.php?f=17&t=872#p3050
nconf-1.3.0-0_not_used_advanced_services_wont_be_written.patch.zip
unzip nconf-1.3.0-0_not_used_advanced_services_wont_be_written.patch.zip
cp nconf-1.3.0-0_not_used_advanced_services_wont_be_written.patch /var/www/nconf
patch -p0 --verbose < nconf-1.3.0-0_not_used_advanced_services_wont_be_written.patch
Hmm… Looks like a unified diff to me…
The text leading up to this was:
————————–
|— bin/lib/NConf/ExportNagios.pm.orig 2011-12-24 13:57:38.620626845 +0100
|+++ bin/lib/NConf/ExportNagios.pm 2011-12-24 14:02:16.870751718 +0100
————————–
Patching file bin/lib/NConf/ExportNagios.pm using Plan A…
Hunk #1 succeeded at 1014.
Hunk #2 succeeded at 1078.
Hunk #3 succeeded at 1111.
done
now copy nagios.cfg to /var/www/nconf/static_cfg
first create a backup copy of nagios.cfg
cp /usr/local/nagios/etc/nagios.cfg /usr/local/nagios/etc/nagios.cfg.orig
cp /usr/local/nagios/etc/nagios.cfg /var/www/nconf/static_cfg/
edit the nconf.cfg file in /var/www/nconf/static_cfg
vim nagios.cfg
comment out all the cfg_files and cfg_dir and insert these:
cfg_dir=/usr/local/nagios/etc/global
cfg_dir=/usr/local/nagios/etc/Default_collector
save and exit:
:wq
Now set permissions on etc and nagios.log
chmod 777 /usr/local/nagios/var/nagios.log
chmod -R 777 /usr/local/nagios/etc/
another nconf bug:
Add line "define('CHECK_STATIC_SYNTAX', 0);" to the file /config/nconf.php
save and exit:
:wq
then copy the image logos:
cp -R /var/www/nconf/img /usr/local/nagios/share/images
Configure the Automatic Deployment on nagios:
open the file /var/www/nconf/config/deployment.ini
modify the following lines as written here:
vim /var/www/nconf/config/deployment.ini
;; LOCAL deployment ;;
[extract config]
type = local
source_file = "/var/www/nconf/output/NagiosConfig.tgz"
target_file = "/tmp/"
action = extract
[copy collector config]
type = local
source_file = "/tmp/Default_collector/"
target_file = "/usr/local/nagios/etc/Default_collector/"
action = copy
[copy global config]
type = local
source_file = "/tmp/global/"
target_file = "/usr/local/nagios/etc/global/"
action = copy
[copy nagios.cfg]
type = local
source_file = "/tmp/static_cfg/nagios.cfg"
target_file = "/usr/local/nagios/etc/nagios.cfg"
action = copy
reload_command = "echo password | sudo /etc/init.d/nagios reload"
Save and exit:
:wq
nagios reload must be done as superuser, so my solution is “echo password | sudo /etc/init.d/nagios reload”
Now Nconf is configured to interact with Nagios.
Use the share button below if you liked it.
Your click is my virtual high-five.