NagiosQL is plugin which provides GUI interface for the configuration of Nagios Core.
In this article, our focus is installation of NagiosQL and we assume that Nagios Core is already installed on the monitoring server. If no, follow this guide.

Perquisite for NagiosQL are

  • Web server (Apache2 and www-data user/group)
  • MySQL   (NagiosQL stores all configuration in DB)
  • Nagios Core (Installation using source code)
  • PHP latest (with all necessary modules)

Install NagiosQL

nagiosql-1

 

  • Use following command to download it inside the terminal at /home/nagiosql path
    # sudo wget http://kaz.dl.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.2.0/nagiosql_320.tar.gz
  • Now copy this .tar.gz file in the /var/www directory (we assumed that apache web server is already install on the machine)  and extract it with following command.
    # cp nagiosql_321.tar.gz /var/www
    # cd /var/www
    # sudo tar -xvzf nagiosql_320.tar.gz
  • After extraction of compressed package, another new directory created under /var/www folder which is shown below. Change the ownership of this new extracted folder using following command
    # chown -R www-data:www-data nagiosql32
  • Type  following address in the web browser  and web page similar shown below will appear in the browser (in this case is localhost).http://SERVER-IP/nagiosql32/

nagiosql-2

 

  • NagiosQL configuration tool required certain permission to change the Naqios Core configuration files from the web interface.
    Following commands will give proper permission to NagiosQL plugin for the successful installation.Apache user name is:  www-data

    Nagios main configuration files are located to /usr/local/nagios.

    # chgrp www-data /usr/local/nagios/etc/
    # chgrp www-data /usr/local/nagios/etc/nagios.cfg
    # chgrp www-data /usr/local/nagios/etc/cgi.cfg
    # chmod 775 /usr/local/nagios/etc/
    # chmod 664 /usr/local/nagios/etc/nagios.cfg
    # chmod 664 /usr/local/nagios/etc/cgi.cfg

    The Nagios binary must be executable by the Apache user

    # chown nagios:www-data /usr/local/bin/nagios
    # chmod 750 /usr/local/bin/nagios
  • Check the Time zone.
    If not set, change the line to /etc/php5/apache2/php.ini.
    Remove the  comment “;”  and set the correct timezone: date.timezone=EUROPE/Rome
    Save it.
  • For the installation of NaqiosQL,  click on the “Start Installation” button at the bottom of NagiosQL main page which is also shown in the following figure.

nagiosql-3

 

  • Next stage is the creation of database for the NagiosQL plugin.
    It uses the database for the storage of configuration for Nagios Core.
    Set log in details for database, enter credentials for NaqiosQL admin user and set configuration path for Naqios Core and also create directory for NaqiosQL configuration.

nagiosql-4

 

  • Press the green row. The next window will resume the installation status:

nagiosql-5

 

  • Click Finish.
  • Browse another time the previous url and enter the credentials

nagiosql-6

 


NagiosQL – Overview

Supervision menu

This menu provides the configuration of Hosts and Services for Nagios Core which is shown in the following figure.

nagiosql-overview-1

 

Alerting menu

In this menu, user can configure the contact information of System Administrator and time periods for alerts.

nagiosql-overview-2

 

Command menu

This menu provides the format and parameters of different command which are used by the Nagios Core monitoring software.

nagiosql-overview-3

Tools menu

Importing of Data, backup files, configuration of Nagios Core, CGI configuration and syntax checking is available in this menu.

nagiosql-overview-4

Adminitration menu

Importing of Data, backup files, configuration of Nagios Core, CGI configuration  and syntax checking is available in this menu.

nagiosql-overview-5

 


NagiosQL – Configuration

In the config target sub menu of Administration menu, we have to set  NagiosQL  files as a Nagios Core configuration, the path of Nagios command file, binary file, process file and main configuration file (nagios.cfg).

nagiosql-conf-1

 

Now you can start to write the commands, the services and populate the hosts.

To apply the configuration, go to the Nagios Control sub menu of Tools menu and click all the buttons to write the common nagios files, the hosts and the services file and restart the Nagios.