Install NConf To Manage Hosts In Nagios Via Web-Based

In the previous article, we explained about adding hosts to Nagios using NRPE agent or not. But maybe it is very hard and confuses too many users because we must add hosts using the command line. This time, we will add hosts using NConf, the application to manage hosts to Nagios via web-based. The application was built using PHP and Perl by Fabian Gander, Angelo Gargiulo, and Bernhard Waldvogel and release latest stable version on 2011 and as of this writing, no more releases since version 1.3.0 is released until now.

We will install NConf using bash script and the script has been tested on CentOS 6 and 7. You can download the script at this link.

After that, follow the following commands:

# unzip nconf-auto.zip
# sh nconf-auto.sh

You must know the script needs your action to configure NConf using a browser. If you see the sentences like these:

that means you have to configure NConf in the browser by following these steps. Open the browser and type http://your_ip_address/nconf then there will be the image:

Click click here and there will be the image:

Make sure all the status is OK and then click Next and there will be the image:

Fill in form like in the picture with DBPASS is nconf and there will be the image:

Make sure all the status is OK and then click Next and there will be the image:

Fill in the form like in the picture and there will be the image:

Change AUTH_ENABLED to true and write your password in the file_admin_password column and click Next then there will be the image:

make sure all status is OK and after that go to script and click any key and the installation will continue. If you don’t configure NConf via browser, then the script will wait until configure NConf via browser finish:
nconf12
The same way is also used when the script asks us to click Generate Nagios config in the browser then we must access NConf via browser using username is admin and type your password in password column then after that click Generate Nagios config.

If there is no error after we click Generate Nagios config, we installed NConf successfully.

Now we try to configure NConf to add new hosts to Nagios. You must realize that after 2011, there is no new version of NConf so we must do some tricks in order to NConf works normally. There are 4 default hosts in Nagios after we install NConf, but only 1 host (localhost) can be monitor and 3 other hosts can not monitor because their IP is wrong.

We can not delete those hosts because Nconf will error so we just change the hosts. If we want to change hplj2605dn to another host example printer1 and its IP is 192.168.56.101, so we must click icon pencil:

and fill the columns like these configurations:

after that click submit and we can see printer1 has been listed in NConf:
then click Generate Nagios config and make sure there is no error after we click it:

Wait 2 minute and go to Nagios and it should printer1 has been appeared in Nagios:

Then check in Service page and you will see service of printer1 has been monitored by Nagios:

If we want just to check service PING to printer1, you can delete service Printer Status in Service tab in Nconf:

then click Generate Nagios config and make sure there is no error after you click it. Wait 2 minutes and it should service Printer Status in service printer1 deleted:

We can change 2 other hosts in the same way but remember don’t change assign host to hostgroup item when you change 2 other default hosts because NConf will error when you click Generate Nagios config.

If you want to receive an email notification from Nagios, change Contacts and Contactgroups tabs and then enter interval time in the hosts tab:

and in host is collector item choose Yes and in active checking item choose 1.

References:
en.wikipedia.org
www.nconf.org
tutor.mlinknetwork.com
support.nagios.com

Leave a Reply

Your email address will not be published. Required fields are marked *