Installing Nagios-3.4.4 in CentOS 6.3

This post is updated version of post “Installing Nagios-3.4 in CentOS 6.3”. The only difference here is , we will use the new EPEL repo rpm i.e epel-release-6-8.noarch.rpm. Rest of the steps are same

Download the EPEL repo in your system

yum install wget (use this command if you do not find wget command in your system)
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

For Directly installing the epel repo rpm with the below command.

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Now installing the Nagios 3.4.4 and its dependencies in the system.

yum install nagios nagios-devel nagios-plugins* gd gd-devel httpd php gcc glibc glibc-common openssl

Bydefualt on doing yum install nagios, in cgi.cfg file, authorized user name nagiosadmin is mentioned and for htpasswd file /etc/nagios/passwd file is used.So for easy steps I am using the same name.

htpasswd -c /etc/nagios/passwd nagiosadmin

Check the below given values in /etc/nagios/cgi.cfg

vi /etc/nagios/cgi.cfg

# AUTHENTICATION USAGE
use_authentication=1

# SYSTEM/PROCESS INFORMATION ACCESS
authorized_for_system_information=nagiosadmin

# CONFIGURATION INFORMATION ACCESS
authorized_for_configuration_information=nagiosadmin

# SYSTEM/PROCESS COMMAND ACCESS
authorized_for_system_commands=nagiosadmin

# GLOBAL HOST/SERVICE VIEW ACCESS
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin

# GLOBAL HOST/SERVICE COMMAND ACCESS
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

For provoding the access to nagiosadmin user in http, /etc/httpd/conf.d/nagios.conf file exist.
Below is the nagios.conf configuration for nagios server.

cat /etc/http/conf.d/nagios.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin/ “/usr/lib/nagios/cgi-bin/”

<Directory “/usr/lib/nagios/cgi-bin/”>
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName “Nagios Access”
AuthType Basic
AuthUserFile /etc/nagios/passwd
Require valid-user
</Directory>

Alias /nagios “/usr/share/nagios/html”

<Directory “/usr/share/nagios/html”>
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
Allow from 127.0.0.1
AuthName “Nagios Access”
AuthType Basic
AuthUserFile /etc/nagios/passwd
Require valid-user
</Directory>

Start the httpd and nagios

/etc/init.d/httpd start
/etc/init.d/nagios start

Note: SELINUX and IPTABLE are disabled.

Access the nagios server by http://nagios_server_ip-address/nagios
Give the username = nagiosadmin and password which you have given to nagiosadmin user.

nagios

In my next post I have described about how to add server for monitoring in nagios server.Given below is the link.
How to install and configure nagios nrpe
 

Read Some More Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.