To Gain Knowledge and to become a one, who all wants to become

Dreams are not those which are seen during sleep ,but Dreams are those which do not let you sleep,so see the dreams
and work hard to make them true.

Thursday, July 29, 2010

NagiosQL3 Installation

Configure NagiosQL3


  •   Webserver e.g. Apache 1.x or above
  •   PHP 4.3 or above
  •   MySQL 4.1 or above
  •   Nagios 2 or above
  •   PEAR Module: HTML_Template_IT 1.1 or above
  •   PHP Extension: gettext
  •   PHP Extension: mysql
  •   PHP Extension: ftp
  •   Javascript enabled at your Webbrowser



Pear modules can be installed automatically by invoking the following command (requires Internet access): 
# pear install HTML_Template_IT   


The NagiosQL translation depends on gnu-gettext and this framework depends on your locale system settings. Make sure you have the appropriate locale installed on your system (e.g. en-GB.utf-8). Please verify that by executing "locale -a". 


Download and extract
Download the latest NagiosQL Version from and extract the nagiosql-*.tar.gz to a directory accessible by your webserver (e.g. /srv/www/htdocs). A subdirectory "nagiosql" will be created: 
# cd /srv/www/htdocs/ 
# wget
# cp /srv/www/htdocs/ # unzip


Directory Structure

It is recommend to have the following directory structure (you can change the directory names in your NagiosQL Domain Configuration): 
/etc/nagiosql/                  -> Common configuration files "            /hosts         -> Host configuration files "            /services   -> Service configuration files "            /backup/   -> Backups of the common configuration files "         "      /hosts  -> Backups of the host configuration files "         "      /services  -> Backups of the service configuration files 


In order to find the configuration files generated by NagiosQL your Nagios configuration must be amended, too. You are free to change the directory names, but be sure to do that in both configuration files (Nagios: nagios.cfg, NagiosQL: Domain Administration). The directory structure (e.g. backup directories below main directories) should never be changed! 
The Nagios configuration file nagios.cfg should be amended to follow the above recommendation: 
cfg_file=/etc/nagiosql/contacttemplates.cfg cfg_file=/etc/nagiosql/contactgroups.cfg cfg_file=/etc/nagiosql/contacts.cfg cfg_file=/etc/nagiosql/timeperiods.cfg cfg_file=/etc/nagiosql/commands.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg cfg_file=/etc/nagiosql/servicegroups.cfg  cfg_dir=/etc/nagiosql/hosts cfg_dir=/etc/nagiosql/services
And optional: 
cfg_file=/etc/nagiosql/hosttemplates.cfg cfg_file=/etc/nagiosql/servicetemplates.cfg cfg_file=/etc/nagiosql/servicedependencies.cfg cfg_file=/etc/nagiosql/serviceescalations.cfg cfg_file=/etc/nagiosql/hostdependencies.cfg cfg_file=/etc/nagiosql/hostescalations.cfg cfg_file=/etc/nagiosql/hostextinfo.cfg cfg_file=/etc/nagiosql/serviceextinfo.cfg  


The following file permissions are required to let NagiosQL read and write the Nagios configuration files. In our example the Apache runs as user "www-data" and the group "www-data" as well as Nagios runs by the user "nagios" and the group "nagios". Instead of the below configuration, you could also add the Apache user to the Nagios group. The configuration files are located at /etc/nagiosql. Please amend if this differs from your installation. 
## Nagios Main Configuration Files  # chgrp www-data /etc/nagios # chgrp www-data /etc/nagios/nagios.cfg # chgrp www-data /etc/nagios/cgi.cfg # chmod 775 /etc/nagios # chmod 664 /etc/nagios/nagios.cfg # chmod 664 /etc/nagios/cgi.cfg  ## NagiosQL Configuration
# chmod 6755 /etc/nagiosql # chown www-data.nagios/etc/nagiosql # chmod 6755 /etc/nagiosql/hosts # chown www-data.nagios/etc/nagiosql/hosts # chmod 6755 /etc/nagiosql/services # chown www-data.nagios /etc/nagiosql/services     ## NagiosQL Backup Configuration   # chmod 6755 /etc/nagiosql/backup # chown www-data.nagios /etc/nagiosql/backup # chmod 6755 /etc/nagiosql/backup/hosts # chown www-data.nagios /etc/nagiosql/backup/hosts # chmod 6755 /etc/nagiosql/backup/services # chown www-data.nagios /etc/nagiosql/backup/services  ## Amend already existing files     # chmod 644 /etc/nagiosql/*.cfg # chown www-data.nagios /etc/nagiosql/*.cfg 
If these directories already have files, amend the permissions for them, too: 
# chmod 644 /etc/nagiosql/hosts/*.cfg # chown www-data.nagios /etc/nagiosql/hosts/*.cfg    # chmod 644 /etc/nagiosql/services/*.cfg # chown www-data.nagios /etc/nagiosql/services/*.cfg     
The Nagios binary must be executable by the Apache user: 
# chown nagios.www-data /usr/sbin/nagios # chmod 750 /usr/sbin/nagios 
Be sure the Apache user is able to write the Nagios commandfile. Please check your nagios.cfg for the correct path to the commandfile! 
# chown /usr/local/nagios/var/rw/nagios.cmd # chmod 660 /usr/local/nagios/var/rw/nagios.cmd 

Verify Installation and Configuration

Please execute as the webserver user "nagios -v /etc/nagios/nagios.cfg" and check for additional permissions.

Running NagiosQL

Now you should be able start NagiosQL: http://www.domain.tld/nagiosql/index.php
The Installation Wizard will help you installing NagiosQL.

Configure Nagios Environment within NagiosQL

After the Installation Wizard succeeded, you should configure your Nagios Environment for NagiosQL. Please login to your fresh installation and navigate to "Administration" => "Domains". Setup your Nagios Environment and if you need help, try the integrated help system first.

No comments:

Post a Comment