Installing NConf with OMD – How-to

Finally: My tutorial on how to install NConf to work with OMD. This is the way I implemented it – which doesn´t mean it´s the best way. I am still not a Nagios/OMD professional – please consider that when reading the article.

The tutorial is based on the official NConf documentation, which can be found at http://www.nconf.org/dokuwiki/doku.php?id=nconf:help:documentation:installation#manual_installation_commandline and extended with my personal experiences under SuSe Linux Enterprise Server 11 SP1.

Before you start with the NConf installation, you have to install a MySQL server with a empty database for NConf. This is done as following (short form):

mysql –-user=USERNAME –-password=PASSWORD

Create the database:

mysql> CREATE DATABASE nconf;

Create the NConf database user:

mysql> GRANT SELECT, INSERT, CREATE, DELETE, UPDATE ON nconf.* 
to 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD';

Also you can check if your MySQL Server has InnoDB activated by typing (needed in order to run NConf)

show engines;

If that´s the case you are ready to start with the NConf installation:

1)    First of all you have to download the NConf archive. You will find it here: http://www.nconf.org/dokuwiki/doku.php?id=nconf:download:main

Version 1.2.6.1 is working great for me.

2)    After that you can extract NConf by entering tar -zxvf nconf-VERSION.tgz. Now you can copy all extracted files to a folder – let´s say /omd/sites/<sitename>/share/nconf and change the permissions of the directorys config,output, static_cfg, temp. You can either set the webserver user as owner or change the permissions to 777 (probably more unsecure).

3)    To make NConf accessible from the webserver we create a file called nconf.conf inside /omd/sites/<sitename>/etc/apache/conf.d/. The following configuration will make NConf accessible with the URL http://NAGIOSSERVER/SITENAME/nconf:

Alias /SITENAME/nconf "/omd/sites/SITENAME/nconf"
<Directory "/omd/sites/SITENAME/share/nconf">
AllowOverride None
</Directory>

4)    Now you can restart Apache with the command omd restart <sitename> apache

5)    Go to http://NAGIOSSERVER/SITENAME/nconf – the setup page should appear. In the following steps you can enter the created database/user/password combination and the setup automatically inserts the database structure.

6)     Now you can remove the installation directories and files, as described by the installer.

7)    In the last step you have to change some variables which don´t match with OMD paths. Go to the file /omd/sites/SITENAME/share/nconf/config/nconf.conf and change the lines

define('NCONFDIR', '/omd/sites/SITENAME/share/nconf'); 
define('NAGIOS_BIN', '/omd/sites/SITENAME/bin/nagios');

to match your installation.

After that you can restart the whole system with omd restart. NConf should work (if not: please comment :D). If you are experiencing database problems: Please see my last post dealing with MySQL problems in version 0.50.

Advertisements

About sitweak
Monitoring, Network, Firewall, Mobile Security. I´m totally into that stuff!

16 Responses to Installing NConf with OMD – How-to

  1. Funny, I’m trying to do this right now! My problem is, /omd/sites/SITE/share/ doesn’t appear to have php-mysql support enabled and I can’t figure out why.

  2. JH says:

    Awesome! Thanks! I JUST was planning on doing this today and so far so good…just need to figure out how to make it see my existing data now 🙂 Cheers!!!

    • JH says:

      Annnnd just as quickly as getting this to work, I’m thinking that it wont work for me as I actually use Check_mk and apparently it’s bad juju mixing the two…hahaha, ah well. Thanks anyhow!!

  3. Marco says:

    This article is very interesting but, reading feedback, is not clear to me if nconf works correctly with check_mk. Sitweak could you confirm to me that you are using them together without problems?

    • sitweak says:

      What do you mean exactly? I’m not so experienced with check_mk. At the moment I’m trying to get WATO working with check_mk and OMD.
      Feel free to write me on twitter … it seems like you are trying to do what I was investigating earlier today.

  4. Marco says:

    Hi Sitweak

    I’ll try to explain my need:
    To be honest with you, I never used OMD but just Nagios with some frontend like nagiosql, groundwork and now Centreon. In particular, lately I’m testing the last one and I can say that it is very nice.The problem is that now in my company (a Service Provider), we are going to setup a Nagios that should manage 15.000 devices and my concern are related to peformance. In fact GUIs often have a price in terms of performance and I founded many posts in Internet related to issues when managing thousands of devices.
    OMD SHOULD take away performance problems but I need a GUI because helpdesk operators have not skills and need an easy method to mange hosts and services.
    Internet drived me to this article and I thought:
    “perfect! OMD + nconf should do the trick”
    But…reading last comments and official doc (http://mathias-kettner.de/checkmk_wato.html) it seems that Nconf is not compatible with check_mk (that come with OMD).
    Now I some questions for you:
    1) Why did you implement Nconf if not compatible with check_mk and if WATO is available?
    2) Do you have experience with Nagios in large environment? (Large I mean about 10.000 devices)
    3) Do you know if OMD store events in Mysql database? This would be useful to extract historical data
    4) Did you ever tried distributed monitoring with Nagios? Scaling in horizontal (satellites) should solve performance problems?

    Regards
    Marco

    • sitweak says:

      Hi Marco,
      1) Until now we´re not using check_mk. At the moment I´m investigating if check_mk is a good option to monitor our linux servers. I implemented NConf because I like the GUI (it´s simple yet uncomplicated) and we have a lot of non check_mk servicechecks. Centreon is too overfeatured for our needs. However, I will try to use WATO for the check_mk clients. From the actual point of view I can´t tell if NConf and WATO can work side-by-side.
      2) Our environment is kinda small (only 250 clients). 3) OMD doesn´t store events in mysql databases. All performance data are stored in rrd databases/files. NDOUtils can be used to write such data in to a mysql database (http://exchange.nagios.org/directory/Addons/Database-Backends/NDOUtils/details) – but you should be aware of the performance. Writing so many events in a database can create a lof of I/O… i think this one of the main reasons why OMD is using RRD files.
      4) I never used distributed monitoring, but it seems kinda easy to implement with OMD.

      My advice is to contact Matthias Kettner. Monitoring 10k devices needs good preparation and planning. He probably had such big projects before and can give you more professional advice when it comes to reporting and storage of historical data of that size. He´s also giving workshops for experiences users!
      It would be nice if we can stay in touch – would love know which experience you make! You have Twitter?

      Sorry that I can´t be more of a help!

  5. Marco says:

    Hi Sitweak

    before all I thanks for your kind reply.

    1) Ok
    3) I meant to store alerts in mysql db and not performance data. Groundwork, ,Opsview, Centeron etc…store events in a mysqld. In my understanding this has pros and cons. I think that the advantages are quite clear: with a db you have the ability to create custom queries, custom views, extract data, etc..
    The disadvantage is always related to performance in a very large environment. In this case performance problems are not stricly related just to nagios but to mysql. Groundwork in fact with last release claimed to support PostgreeSQL just to solve this problem. To be honest I don’t know if this is true or not….I’m just trying to understand
    What I can say about my direct experience is that at the moment we are monitoring 1500 devices with Zenoss Enterprise that use mysql for events and rrd for performance but we have some performance problems. Moreover it is expensive; this is the reason we are evaluating Nagios for this large customer.

    Contact Matthias Ketnerr? Good Idea…I could try but the point of question is if he will reply to me 🙂
    Anyway at the moment I’m just studying and I’m not still sure that our project will take place. If it will, I’ll let you know and I’ll share with you my experience.
    I don’t have twitter but we can keep in touch by email. Please contact me whenever you want.
    You helped me a lot! Thanks again for your kind reply!

  6. sitweak says:

    I´m pretty sure that Matthias will answer. He is active in forums (http://www.nagios-portal.org/wbb/index.php – unfortunately it´s german :/) and also offers charged services (even support contracts).

    I will post here as soon as I make new achievements!

  7. Avi says:

    The above procedure works fine, On the NConf webpage when you click “To install NConf click here” nothing happens and the webpage stays as such, what is missing in NConf configuration ?

  8. Gbenga Adigun says:

    @Avi..This may be due to the fact that you don’t have php-mysql module installed. Try installing yum install php-mysql. Then try again.

    Is anyone facing issues generating config file with Icinga, am always getting the following error:

    Reading configuration data…
    Error: Cannot open main configuration file ‘/omd/sites/gbenga/share/nconf/temp/test/Default_collector.cfg’ for reading!
    Error processing main config file!

    Any help with this will be appreciated.

    • sitweak says:

      Sorry, I can´t give you any good advice with that. We switched to Check_MK since it offers auto-inventory which makes configuration so much easier!

  9. Bear says:

    For those who may run into issues with OMD 1.00 | NConf 1.3 | Ubuntu Server 12.04:

    For the line to specific the host to connect to the mysql DB, “localhost” does not work. I had to use 127.0.0.1 for it recognize the socket correctly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: