Verify the sample nagios configuration files
[root@localhost nagios-plugins-1.4.16]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
It should display without error like this
Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 8 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 24 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@localhost nagios-plugins-1.4.16]#
Modify SELinux and Firewall Settings
[root@localhost nagios-plugins-1.4.16]# getenforce
Enforcing
[root@localhost nagios-plugins-1.4.16]# service iptables status
iptables: Firewall is not running.
Once firewall running then stop that
[root@localhost nagios-plugins-1.4.16]# service iptables stop
Change SELinux mode Enforcing to Permissive mode
[root@localhost nagios-plugins-1.4.16]# setenforce 0
If you want to permanently change this, then you need to change below configuration file and reboot your machine.
[root@localhost nagios-plugins-1.4.16]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Now restart the nagios service
[root@localhost nagios-plugins-1.4.16]# /etc/init.d/nagios restart
Web interface configuration
[root@localhost nagios]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin
[root@localhost nagios]#
username: nagiosadmin
Now restart the httpd service
[root@localhost nagios]# /etc/init.d/httpd restart
You can able to access nagios monitoring system through url with username and password
http://10.118.248.52/nagios/ or http://localhost/nagios/