Welcome to Part 2 instructions. We assume you have completed Step 1 – Installing Nagios Core Service successfully. Read this article to NagiosQL3 web interface for Administration of Nagios 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.

#  install libssh2 libssh2-devel  mysql-server -mysql

Also install ssh2 pecl extension for php. You can use one of below commands to install it.

# pecl install ssh2

[if above command not worked use below else skip it]

# pecl install channel://pecl.php.net/ssh2-0.12

Step 2: Download NagiosQL3 and Extract

Download latest available nagiosql3 archive and extract in nagios document root using below commands.

# cd /usr/local/nagios/
# 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 .
# chmod -R 775 .

Step 3: Set Up Timezone

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

date.timezone = 'Asia/Kolkata'

We also need to restart Apache server after editing php configuration time.

# 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 showing 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

nagiosql-1

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
nagiosql-2

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

nagiosql-3-3

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

4.4: Finishing Setup

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

4.5: NagiosQL Login

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

Step 5: Access NagiosQL3 Web Interface

After completing web installer, it will automatically redirect you to nagiosql3 admin panel. To open it later use below url.

http://svr2.tecadmin.net/nagios/webadmin

Step 6: Configure NagiosQL3 with Nagios Core

This is the most important part of NagiosQL setup, It may be your setup is different that 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.

nagiosql-config-1

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

nagiosql-config-2

6.2: Edit Nagios Core Configuration File

Now edit nagios configuration file ( Eg: /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/contacts.cfg
 #cfg_file=/usr/local/nagios/nagiosql/timeperiods.cfg
 #cfg_file=/usr/local/nagios/nagiosql/templates.cfg
 #cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
 #cfg_file=/usr/local/nagios/etc/objects/windows.cfg
 #cfg_file=/usr/local/nagios/etc/objects/.cfg
 #cfg_file=/usr/local/nagios/etc/objects/printer.cfg

 cfg_dir=/usr/local/nagios/nagiosql 
 
 #cfg_dir=/usr/local/nagios/etc/servers
 #cfg_dir=/usr/local/nagios/etc/printers
 #cfg_dir=/usr/local/nagios/etc/switches
 #cfg_dir=/usr/local/nagios/etc/routers

Step 7: Restart Nagios Core Service

Finally verify nagios core configuration file and restart service using below commands.

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

If above command show 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
http://www.nagiosql.org/documentation.html

Print Friendly

Comments

comments

Bài viết liên quan