Nagios is an open source monitoring tool for the network devices. It uses snmp protocol for the monitoring of network devices. Nagios Core supports configuration from CLI which is not easy for new users. 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 and net-snmp is already installed on the monitoring server.
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)
We have VM ( 3GB RAM and 80GB HD space) with Ubuntu 14.01 LTS OS installed on it. Nagios Core and Net-snmp package are already installed on it. In this article, we will learn installation of NagiosQL , its integration with Nagios Core and status of different objects of VM on Nagios Core.
First of all download package from nagiosql.org website
Use following command to download it inside the terminal at /home/test/Download 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
$ 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
$ sudo 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.
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.
NsqiosQL 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 under /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
Time zone setting in PHP.ini
Time zone error is shown in the above figure. It can be fixed by changing following line in /etc/php4/apache2 .Remove the comment ";" from date.timezone =America/Chicago option and save it .
After fix on this page, a green arrow button will appear at the bottom right corner of the page. Click Next to move on the next stage.
Next stage is the creation of database for the NagiosQL plugin. It uses the database for the storage of configuration for Nagios Core. On this page, 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.
Following window will appear after the successful creation of DB on the machine.
Click on the Finish button and log in NagiosQL site by pointing your browser to http://server-ip-address/nagiosql32/ (server_ip_address is the address of server). Log in with the credentials you have entered during installation process. Enter user name and password to get access to web interface of NagiosQL which is shown below
Introducing some of the nagiosQL menus for your reference.
This menu provides the configuration of Hosts and Services for Nagios Core which is shown in the following figure.
In this menu, user can configure the contact information of System Administrator and time periods for alerts.
This menu provides the format and parameters of different command which are used by the Nagios Core monitoring software.
Importing of Data, backup files, configuration of Nagios Core , CGI configuration and syntax checking is available in this menu.
This menu provides the setting for the NagiosQL plugin. User can change the password, add user for maintenance of server, logs and setting etc.
In the config target sub menu, we have to set NagiosQL files as a Nagios Core configuration which is shown below. we also set the path of Nagios command file, binary file, process file and main configuration file (nagios.cfg).
After path changes in NagiosQL front end, verify the configuration files from command line and restart the nagios daemon.
In this article, we explain the installation of NagiosQL which is graphical configuration tool for well-known monitoring tool Nagios Core. Nagios uses SNMP protocol (support all versions) for monitoring of network devices such as servers, router and switches. NagiosQL web interface provides an easy way for complex configuration of Nagios. NagiosQL uses database on the back end for the permanent storage of configuration.