Installing Nagios-3.4 in CentOS 6.3

Installing Nagios-3.4 in CentOS 6.3

This is how to install nagios 3.4 tutorial for installing nagios-3.4 in CentOS 6.3 in a few steps.

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

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

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.

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

2 thoughts on “Installing Nagios-3.4 in CentOS 6.3”

Leave a Comment

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