How-to – Install NagiosQL


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



  • Use following command to download it inside the terminal at /home/nagiosql path
    # sudo wget
  • 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 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.



  • 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.



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



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



NagiosQL – Overview

Supervision menu

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



Alerting menu

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



Command menu

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


Tools menu

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


Adminitration menu

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



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).



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.