How to Setup NagiosQL3 (Nagios Web UI) on Linux

Channel: Linux
Abstract: verify Nagios core configuration file and restart service using commands. /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgmake sure al

Firstly, make sure you have installed Nagios core service. Else use our previous articles for installation steps of Nagios core service on Redhat based systems or Debian based system. Now read this article to install NagiosQL3 web interface for Administration of Nagios server using web interface. If you have installed Nagios core service with some other type. Please be careful with directories and files path and configuration files.

We have successfully configured and integrated NagiosQL with Nagios using below steps. But we can not sure that it will 100% work for you. You may get few errors during setup. Feel free to ask related to any issues on comments for our question/answers section.

Step 1 – Install Required Packages

First, we need to install required packages, Use the following commands to install them.

RedHat Based Systems:

yum install libssh2 libssh2-devel mysql mysql-server php-mysql php-pear php-devel

pecl install ssh2
##if above command not worked use below else skip it
pecl install channel://pecl.php.net/ssh2-0.12

Debian Based Systems:

sudo apt-get install libssh2-1 libssh2-1-dev mysql mysql-server
sudo apt-get install php-mysql php-pear php-devel php-ssh2 php-gettxt
Step 2 – Download NagiosQL3 Archive

Download the latest available nagiosql3 archive and extract in Nagios document root using commands.

cd /usr/local/nagios/share
wget http://sourceforge.net/projects/nagiosql/files/nagiosql/NagiosQL%203.2.0/nagiosql_320.tar.gz
tar xzf nagiosql_320.tar.gz
mv nagiosql32 webadmin
chown -R apache:apache .
chmod -R 775 .
Step 3 – Setup PHP Timezone

Edit php.ini file and update following variable with required timezone. Click here to get list of available timezone

[Date] ; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone = 'Asia/Kolkata'12345[Date]; Defines the default timezone used by the date functions; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone = 'Asia/Kolkata'

Restart Apache web server after editing PHP configuration.

service httpd restart
Step 4 – Start NagiosQL3 Web Installer

NagiosQL3 provides web installer to install package. Open below URL to start web installer for nagiosql. follow steps as shown in URL. Web installer will help you about for any changes required.

http://svr1.tecadmin.net/nagios/webadmin/install/index.php
4.1: Start Installation Wizzard

Open the above url and click the button START INSTALLATION

4.2: Verify Requirements

At this screen, installer will check the required packages are installed or not. If you see any error on this screen, fix that manually and click Next

4.3: NagiosQL Setup

In this step installer will input the database details to be used for nagiosql. Also update the nagiosql path values as per given screenshots. Click Next

If you have installed Nagios at some other place, only then change the values of the path.

4.4: Finishing Setup

This screen showing that all the steps has successfully completed. You just need to click Next

4.5: NagiosQL Login

After completing installation, you will be redirected to NagiosQL login screen.

Step 5 – Access NagiosQL3 Web UI

After completing web installer, it will automatically redirect you to the nagiosql3 admin panel. To open it later using URL.

http://svr1.tecadmin.net/nagios/webadmin
Step 6 – Integrate NagiosQL3 with Nagios

This is the most important part of NagiosQL setup, It may be your setup is different than me, so be careful with below step. I am trying my best to write to complete integration.

6.1 – Edit NagiosQL Configuration

Login to NagiosQL administrator section and navigate to Administration -> Administration -> Config targets and click on Modify button for Local installation.

At the below screen, you will find configuration file path, make sure all folder exists in the first section and check the file’s path with Nagios core configuration file.

6.2 – Edit Nagios Core Configuration File

Now edit nagios configuration file /usr/local/nagios/etc/nagios.cfg and commend all earlier cfg_file and cfg_dir configuration settings and add new cfg_dir with /usr/local/nagios/nagiosql only.

cfg_file=/usr/local/nagios/nagiosql/commands.cfg
cfg_file=/usr/local/nagios/nagiosql/contactgroups.cfg
cfg_file=/usr/local/nagios/nagiosql/contacts.cfg
cfg_file=/usr/local/nagios/nagiosql/contacttemplates.cfg
cfg_file=/usr/local/nagios/nagiosql/hostdependencies.cfg
cfg_file=/usr/local/nagios/nagiosql/hostescalations.cfg
cfg_file=/usr/local/nagios/nagiosql/hostextinfo.cfg
cfg_file=/usr/local/nagios/nagiosql/hostgroups.cfg
cfg_file=/usr/local/nagios/nagiosql/hosttemplates.cfg
cfg_file=/usr/local/nagios/nagiosql/servicedependencies.cfg
cfg_file=/usr/local/nagios/nagiosql/serviceescalations.cfg
cfg_file=/usr/local/nagios/nagiosql/serviceextinfo.cfg
cfg_file=/usr/local/nagios/nagiosql/servicegroups.cfg
cfg_file=/usr/local/nagios/nagiosql/servicetemplates.cfg
cfg_file=/usr/local/nagios/nagiosql/timeperiods.cfg

cfg_dir=/usr/local/nagios/nagiosql/hosts
cfg_dir=/usr/local/nagios/nagiosql/services

Step 7 – Restart Nagios Core Service

Finally, verify Nagios core configuration file and restart service using commands.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If above command shows no errors on screen, restart Nagios core service

service nagios restart

Congratulation’s You have successfully installed Nagios with NagiosQL3.

References:
http://www.nagios.org/about

Ref From: tecadmin

Related articles