How to Install Nagios Monitoring in RHEL, Rocky, and AlmaLinux

Nagios is an awesome Open Source monitoring tool, that provides a more comprehensive monitoring environment to always keep an eye on your all machines/networks whether you are in your data center or just your small labs.

With Nagios, you can monitor your remote hosts and their services remotely on a single window. It shows warnings and indicates if something goes wrong in your servers which eventually helps us to detect some problems before they occur. It helps us to reduce downtime and business losses.

Recently, Nagios released its latest version Nagios Core 4.4.9, and its latest stable release of Nagios plugins 2.3.3 on October 4, 2022.

This article is intended to guide you with easy instructions on how to install and configure the latest version of Nagios Core from source (tarball) on RHEL and RHEL-based distributions such as CentOS Stream, Rocky Linux, AlmaLinux, and Fedora.

Within 30 minutes you will be monitoring your local machine, no advanced installation procedure only basic installation that will work 100% on most of today’s Linux servers.

Please Note: The installation instructions shown here are written based on the RHEL 9.0 Linux distribution.

Installing Nagios Core and Nagios Plugin in Linux

If you follow these instructions correctly, you will end up with the following information.

  • Nagios and its plugins will be installed under the /usr/local/nagios directory.
  • Nagios will be configured to monitor a few services of your local machine (Disk Usage, CPU Load, Current Users, Total Processes, etc.)
  • Nagios web interface will be available at http://localhost/nagios

Step 1: Install Apache and PHP Packages

We need to install Apache, PHP, and some libraries like gcc, glibc, glibc-common, and GD libraries and their development libraries before installing Nagios with the source. And to do so, we can use the yum package installer.

# yum install -y httpd httpd-tools php gcc glibc glibc-common gd gd-devel make net-snmp
Install Apache and PHP
Install Apache and PHP

Step 2: Create Nagios User and Group

Create a new nagios user using the useradd command and nagcmd group account and set a password.

[root@tecmint]# useradd nagios
[root@tecmint]# groupadd nagcmd

Next, add both the nagios user and the apache user to the nagcmd group using the usermod command.

[root@tecmint]# usermod -G nagcmd nagios
[root@tecmint]# usermod -G nagcmd apache
Add Nagios User and Group
Add Nagios User and Group

Step 3: Download Nagios Core and Nagios Plugin

Create a directory for your Nagios installation and all its future downloads.

[root@tecmint]# mkdir /root/nagios
[root@tecmint]# cd /root/nagios

Now download the latest Nagios Core and Nagios Plugins packages with the wget command.

# wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.9.tar.gz
# wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
Download Nagios Core and Nagios Plugins
Download Nagios Core and Nagios Plugins

Step 4: Extract Nagios Core and Nagios Plugins

We need to extract downloaded packages with the tar command as follows.

# tar -xf nagios-4.4.9.tar.gz
# tar -xf nagios-plugins-2.3.3.tar.gz

When you extract these tarballs, two new folders will appear in that directory.

# ls -l

total 13804
drwxrwxr-x 21 root root     4096 Nov 17 02:22 nagios-4.4.9
-rw-r--r--  1 root root 11339450 Nov 17 03:08 nagios-4.4.9.tar.gz
drwxr-xr-x 15 root root     4096 Mar 11  2020 nagios-plugins-2.3.3
-rw-r--r--  1 root root  2782610 Mar 11  2020 nagios-plugins-2.3.3.tar.gz

Step 5: Installing and Configuring Nagios Core

Now, first, we will configure Nagios Core and to do so we need to go to the Nagios directory and run configure file if everything goes fine, it will show the output in the end as sample output.

# cd nagios-4.4.9/
# ./configure --with-command-group=nagcmd
Configure Nagios Core
Configure Nagios Core
Configuration Summary for Nagios Core
Creating sample config files in sample-config/ ...


*** Configuration summary for nagios 4.4.9 2022-11-16 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagcmd
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
    Install ${includedir}:  /usr/local/nagios/include/nagios
                Lock file:  /run/nagios.lock
   Check the result directory:  /usr/local/nagios/var/spool/checkresults
           Init directory:  /lib/systemd/system
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /usr/bin/mail
                  Host OS:  linux-gnu
          IOBroker Method:  epoll

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

After configuring, we need to compile and install all the binaries with the make all and make install commands, it will install all the needed libraries in your machine and we can proceed further.

# make all
# make install
Nagios Compilation Summary
*** Main program, CGIs and HTML files installed ***

You can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install-init
     - This installs the init script in /lib/systemd/system

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs sample config files in /usr/local/nagios/etc

make[1]: Leaving directory '/root/nagios/nagios-4.4.9'

The following command will install the init scripts for Nagios.

# make install-init

To make Nagios work from the command line we need to install command-mode.

# make install-commandmode

Next, install sample Nagios files, please run the following command.

# make install-config
Nagios Configuration Files Installed
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/objects
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg
/usr/bin/install -c -b -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/templates.cfg /usr/local/nagios/etc/objects/templates.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/commands.cfg /usr/local/nagios/etc/objects/commands.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/contacts.cfg /usr/local/nagios/etc/objects/contacts.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/timeperiods.cfg /usr/local/nagios/etc/objects/timeperiods.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/localhost.cfg /usr/local/nagios/etc/objects/localhost.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/windows.cfg /usr/local/nagios/etc/objects/windows.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/printer.cfg /usr/local/nagios/etc/objects/printer.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/switch.cfg /usr/local/nagios/etc/objects/switch.cfg

*** Config files installed ***

Remember, these are *SAMPLE* config files.  You'll need to read
the documentation for more information on how to actually define
services, hosts, etc. to fit your particular needs.

Step 6: Customizing Nagios Configuration

Open the “contacts.cfg” file with your choice of editor and set the email address associated with the nagiosadmin contact definition to receiving email alerts.

# vi /usr/local/nagios/etc/objects/contacts.cfg
Nagios Email Alerts
###############################################################################
#
# CONTACTS
#
###############################################################################

# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the
# 'generic-contact' template which is defined elsewhere.

define contact {

    contact_name            nagiosadmin             ; Short name of user
    use                     generic-contact         ; Inherit default values from generic-contact template (defined above)
    alias                   Nagios Admin            ; Full name of user
    email                   [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

Step 7: Install and Configure the Web Interface for Nagios

We are done with all configurations in the backend, now we will configure the Web Interface For Nagios with the following command. The below command will Configure the Web interface for Nagios and a web admin user will be created “nagiosadmin”.

# make install-webconf
Configure Nagios Web
Configure Nagios Web

In this step, we will be creating a password for “nagiosadmin”. After executing this command, please provide a password twice and keep it remember because this password will be used when you login into the Nagios Web interface.

# htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

Restart Apache to make the new settings take effect.

# systemctl restart httpd

Step 8: Compile and Install Nagios Plugin

go there and configure and install it as directed below.

# cd /root/nagios
# cd nagios-plugins-2.3.3
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make
# make install

Step 9: Verify Nagios Configuration Files

Now we are all done with the Nagios configuration and it’s time to verify it to do so please insert the following command. If everything goes smoothly it will show up similar to the below output.

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Configuration Summary
Nagios Core 4.4.9
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2022-11-16
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
	Checked 8 services.
	Checked 1 hosts.
	Checked 1 host groups.
	Checked 0 service groups.
	Checked 1 contacts.
	Checked 1 contact groups.
	Checked 24 commands.
	Checked 5 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 1 hosts
	Checked 0 service dependencies
	Checked 0 host dependencies
	Checked 5 timeperiods
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

Step 10: Add Nagios Services to System Startup

To make Nagios work across reboots, we need to enable nagios and httpd at the system startup using the systemctl command.

# systemctl enable nagios
# systemctl enable httpd

Next, restart Nagios to make the new settings take effect.

# systemctl restart nagios

Step 11: Allow Nagios Web in Firewall

To access the Nagios web interface, you need to open the Apache ports by running the following commands:

# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload

Step 12: Log in to the Nagios Web Interface

Your Nagios is ready to work, please open it in your browser with “http://Your-server-IP-address/nagios” or “http://FQDN/nagios” and Provide the username “nagiosadmin” and password.

Nagios Web Dashboard
Nagios Dashboard
Nagios Dashboard
Host View
Nagios Host View
Nagios Host View
Nagios Overview
Nagios Overview
Nagios Overview
Services View
Nagios Host Services
Nagios Host Services
Process View
Nagios Process View
Nagios Process View

Congratulations! You’ve successfully installed and configured Nagios and its Plugins. You’ve just started your journey into monitoring.

Upgrading Nagios 3.x to Nagios Core 4.x

If you are already running an older version of Nagios, you can upgrade it anytime. To do so, you just need to download the latest nagios source tar archive and configure it as shown below.

# systemctl stop nagios
# wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.9.tar.gz
# tar -zxvf nagios-4.4.9.tar.gz
# cd nagios-4.4.9
# ./configure
# make all
# make install
# systemctl start nagios
Conclusion

That’s it for now, in my upcoming articles, I will show you how to add Linux, Windows, Printers, Switches, and Devices to Nagios monitoring Server.

If you’re having any trouble while installing, please do contact us via comments. Till then stay tuned and connected to Tecmint and don’t forget to Like and Share us to spread around.

Read Also:

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

418 Comments

Leave a Reply
  1. When I run the command “systemctl start httpd.service“. It shows the following error “Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.”

    Can anyone please help for the same…

    Reply
  2. # make install-commandmode
    /usr/bin/install -c -m 775 -o nagios -g nagcmd -d /usr/local/nagios/var/rw
    
    # chmod g+s /usr/local/nagios/var/rw
    
    *** External command directory configured ***
    
    # make install-config
    /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
    /usr/bin/install: invalid group ‘nagios’
    make: *** [install-config] Error 1
    -bash-4.2# 
    

    During nagios core installation steps I got the above error, I have created the group already

    # useradd -m nagios
    useradd: user 'nagios' already exists
    # groupadd nagcmd
    groupadd: group 'nagcmd' already exists
    # usermod -a -G nagcmd nagios
    # usermod -a -G nagcmd apache
    # pwd
    

    Please advise to proceed further

    Reply
  3. All installation fine, the problem when accessing the nagios on browser.

    servername/nagios
    Error
    Forbidden
    You Don't have permission to aces /nagios/on this server.
    

    Kindly assist?

    Reply
    • @Rashid,

      It’s something SELinux preventing from the accessing the nagios page, try to set SELinux to permissive mode, you can use the following command to set:

      # chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
      # chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
      

      Don’t forget to restart the Apache service..

      Reply
  4. Hi,

    I am also new to Linux. I am also having same problem as you mention in your first comment. Can you please mention the details about port forwarding. I have installed nagios on server . I am getting error of 404 not found.

    Please help.
    Thank you.

    Reply
  5. Hello.

    I try to set up this nagios service but, well when it asks me user and password I provide “nagiosadmin” and “password“. Nevertheless I can’t access the web interface.

    Would you provide me the right username and password please?

    James

    Reply
    • @James,

      Run this following command to set new password again for Nagios admin.

      htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
      
      Reply
      • Hi, After running the above command, I get the output like.

        htpasswd: cannot create file /usr/local/nagios/etc/htpasswd.users
        

        what should I do?

        Reply
        • @Sam,

          Try to disable SELinux and try again or create file htpasswd.users manually and run the command again.

          # htpasswd -c /usr/local/nagios/etc/htpasswd.users
          
          Reply
  6. Hi,

    I am a beginner with Linux and network monitoring tools. I am installing Nagios 4.3.4 on CentOS 7. I followed the instructions posted here however, I cannot access the web interface. Should I have modified some config file to provide the IP address of my machine/server, please? Could you please point me towards things which I could check?

    Thank you.

    Reply
      • Hi Ravi,

        Thank you for your prompt reply!

        I was getting the ‘This site can’t be reached’ error on Google Chrome upon trying to access the Nagios web interface via http://10.0.2.15. However, I managed to solve this. I had forgotten to mention that I installed Nagios on a virtual machine on PC. The problem that I was having was due to a port forwarding issue it seems. I set up port forwarding (for port 80) from the VM to the PC and now everything works just fine :)

        Thank you for your help and interest!

        Reply
        • Hi I got an error the same as you. I try to do many things still not help.

          I disabled SElinux
          add port “12489 ” in firwalld.
          and after check i found the problem when i start
          ==================================================
          [root@Nagios ~]# systemctl enable nagios
          nagios.service is not a native service, redirecting to /sbin/chkconfig.
          Executing /sbin/chkconfig nagios on
          The unit files have no [Install] section. They are not meant to be enabled
          using systemctl.
          Possible reasons for having this kind of units are:
          1) A unit may be statically enabled by being symlinked from another unit’s
          .wants/ or .requires/ directory.
          2) A unit’s purpose may be to act as a helper for some other unit which has
          a requirement dependency on it.
          3) A unit may be started when needed via activation (socket, path, timer,
          D-Bus, udev, scripted systemctl call, …).
          ======================================================
          ==>> can anyone help me?!

          Reply
  7. Dear Ravi,

    I did the same as you said in this file /usr/local/nagios/etc/nagios.cfg but no luck still service not running see the logs below

    Stopping LSB: Starts and stops the Nagios monitoring server…
    Jan 11 11:47:11 nagiosserver1 nagios: Stopping nagios:/etc/rc.d/init.d/nagios: line 140: kill: (1194) – No such process
    Jan 11 11:47:11 nagiosserver1 nagios: done.
    Jan 11 11:47:11 nagiosserver1 systemd: Starting LSB: Starts and stops the Nagios monitoring server…
    Jan 11 11:47:11 nagiosserver1 nagios: Nagios 4.1.1 starting… (PID=2746)
    Jan 11 11:47:11 nagiosserver1 nagios: Starting nagios: done.
    Jan 11 11:47:11 nagiosserver1 systemd: Started LSB: Starts and stops the Nagios monitoring server.
    Jan 11 11:47:12 nagiosserver1 nagios: Local time is Thu Jan 11 11:47:11 +03 2018
    Jan 11 11:47:12 nagiosserver1 nagios: LOG VERSION: 2.0
    Jan 11 11:47:12 nagiosserver1 nagios: qh: Failed to init socket ‘/usr/local/nagios/var/rw/nagios.qh’. bind() failed: No such file or directory
    Jan 11 11:47:12 nagiosserver1 nagios: Error: Failed to initialize query handler. Aborting

    Reply
  8. @ravi

    I have verified nagios configuration as per your above process configuration is all OK. but in my nagios web URL on homepage i am getting a message “nagios core not running” it is not showing nagios running with PID. in TOP command result also there no PID associated to nagios.

    please find below commands outputs

    [root@nagiosserver1 ~]# systemctl status nagios
    ● nagios.service - LSB: Starts and stops the Nagios monitoring server
       Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
       Active: active (exited) since Tue 2018-01-09 19:26:59 +03; 13h ago
         Docs: man:systemd-sysv-generator(8)
      Process: 4467 ExecReload=/etc/rc.d/init.d/nagios reload (code=killed, signal=T                                                                                        ERM)
      Process: 4926 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/S                                                                                        UCCESS)
    
    Jan 09 19:26:59 nagiosserver1 systemd[1]: Starting LSB: Starts and stops the....
    Jan 09 19:26:59 nagiosserver1 systemd[1]: Started LSB: Starts and stops the ....
    Jan 09 19:26:59 nagiosserver1 nagios[4926]: Starting nagios: done.
    Hint: Some lines were ellipsized, use -l to show in full.
    
    [root@nagiosserver1 ~]# service nagios status
    nagios is not running
    
    [root@nagiosserver1 ~]# df -h
    Filesystem               Size  Used Avail Use% Mounted on
    /dev/mapper/centos-root  4.9G  3.7G  1.2G  76% /
    devtmpfs                 473M     0  473M   0% /dev
    tmpfs                    489M     0  489M   0% /dev/shm
    tmpfs                    489M  7.2M  482M   2% /run
    tmpfs                    489M     0  489M   0% /sys/fs/cgroup
    /dev/sda1                297M  144M  154M  49% /boot
    /dev/mapper/centos-var   997M  509M  488M  52% /var
    /dev/sr0                 4.3G  4.3G     0 100% /run/media/root/CentOS 7 x86_64
    tmpfs                     98M     0   98M   0% /run/user/0
    [root@nagiosserver1 ~]#
    

    Please also see below logs while restarting nagios service these logs are generated.

     systemd: Starting LSB: Starts and stops the Nagios monitoring server...
    Jan 10 09:13:49 nagiosserver1 nagios: Nagios 4.1.1 starting... (PID=8415)
    Jan 10 09:13:49 nagiosserver1 nagios: Local time is Wed Jan 10 09:13:49 +03 2018
    Jan 10 09:13:49 nagiosserver1 nagios: LOG VERSION: 2.0
    Jan 10 09:13:49 nagiosserver1 nagios: qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. 
    bind() failed: No such file or directory
    Jan 10 09:13:49 nagiosserver1 nagios: Error: Failed to initialize query handler. Aborting
    Jan 10 09:13:50 nagiosserver1 systemd: Started LSB: Starts and stops the Nagios monitoring server.
    Jan 10 09:13:50 nagiosserver1 nagios: Starting nagios: done.
    

    Please note i am running this in vmware on centos 7

    Reply
    • @Shuja,

      Could you share exact error message with us? so that we can have better idea. Also have you verified your nagios configuration?

      Reply
  9. Hi,

    I installed the Nagios and everything goes okay but when i open it browser in Google Chrome it show this message

    Not Found
    The requested URL /nagios was not found on this server.
    

    What can i do now?

    Reply
    • @Raju,

      It’s clear that your Nagios installation wasn’t successful, try to follow Nagios installation instructions carefully..

      Reply
  10. Reusing existing connection to assets.nagios.com:443.
    HTTP request sent, awaiting response… 404 Not Found
    2017-12-24 01:19:38 ERROR 404: Not Found.

    Reply
  11. getting below error while running above command

    /usr/local/nagios/etc/nagios.cfg
    /usr/local/nagios/etc/nagios.cfg: line 1144: syntax error near unexpected token `|’
    /usr/local/nagios/etc/nagios.cfg: line 1144: `illegal_macro_output_chars=`~$&|'”‘

    Reply
  12. From command line [using links] I am able to access nagios, but the same fails when I try to hit the URL from a remote host.

    When trying to access nagios from remote host via browser, after entering credentials for nagiosadmin on browser- receiving a blank page [connection reset]. Log shows that it might be failing to load main.php and side.php after user authorization.
    Any suggestions please on what can be the issue?

    Troubleshooting steps tried so far:
    – Able to access a static php from remote host via browser
    – Tried from different browsers [Mozilla, Chrome, IE]
    – Able to telnet from remote host to server [Port 80]
    – Provided all access to files [/usr/local/nagios/etc/htpasswd.users, /usr/local/nagios/share/main.php, side.php]
    – Both server and remote hosts are on the same timezone
    – HTTP is running as user -apache

    Versions installed: nagios-4.3.4, nagios-plugins-2.2.1
    OS: RHEL 6.9
    Packages installed: httpd, httpd-tools, php, gcc, glibc, glibc-common, gd, gd-devel, make, net-snmp

    Logs when accessing on local using command line [links]
    [23/Nov/2017:09:34:34 +0000] “GET /nagios HTTP/1.1” 401 482 “-” “Links (2.13; Linux; GNU C 4.4.7; text)”
    nagiosadmin [23/Nov/2017:09:34:42 +0000] “GET /nagios HTTP/1.1” 301 318 “-” “Links (2.13; Linux; GNU C 4.4.7; text)”
    nagiosadmin [23/Nov/2017:09:34:42 +0000] “GET /nagios/ HTTP/1.1” 200 1079 “-” “Links (2.13; Linux; GNU C 4.4.7; text)”
    nagiosadmin [23/Nov/2017:09:34:42 +0000] “GET /nagios/side.php HTTP/1.1” 200 4735 “http://xx.xx.xx.xx/nagios/” “Links (2.13; Linux; GNU C 4.4.7; text)”
    nagiosadmin [23/Nov/2017:09:34:42 +0000] “GET /nagios/main.php HTTP/1.1” 200 7993 “http://xx.xx.xx.xx/nagios/” “Links (2.13; Linux; GNU C 4.4.7; text)”

    Logs when accessing from remote host.
    [23/Nov/2017:09:59:31 +0000] “GET /nagios HTTP/1.1” 401 482 “-” “Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0”
    nagiosadmin [23/Nov/2017:09:59:39 +0000] “GET /nagios HTTP/1.1” 301 318 “-” “Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0”

    Reply
      • Thanks Ravi,

        I did check firewall rules and they are disabled.
        Though I am still unable to connect to console after entering nagiosadmin credentials.

        Current status on nagios server::
        # /sbin/service iptables status
        iptables: Firewall is not running.
        :
        # sestatus
        SELinux status: disabled
        :
        # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
        Nagios Core 4.3.4
        Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
        Copyright (c) 1999-2009 Ethan Galstad
        Last Modified: 2017-08-24
        License: GPL
        Website: https://www.nagios.org
        Reading configuration data…
        Read main config file okay…
        Read object config files okay…
        Running pre-flight check on configuration data…
        Checking objects…
        Checked 8 services.
        Checked 1 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
        Checking for circular paths…
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
        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

        Not sure why I am able to access a static php from my remote host hosted using the same httpd.conf on the nagios server, but unable to hit /nagios.

        It does prompt for user credentials but does not load the nagios console.

        Reply
  13. Dear Sir,

    Thank you for valuable. Nagios configuration is done properly. Please help to how to add servers and services in Nagios.

    How to create Nagios database ? In new configure Nagios, no database was created in Mysql.

    Reply
    • @Shuja,

      Please verify Nagios configuration for errors using following command, if any errors shown, fix it accordingly.

      # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
      
      Reply
      • /usr/local/nagios/etc/nagios.cfg
        /usr/local/nagios/etc/nagios.cfg: line 1144: syntax error near unexpected token `|’
        /usr/local/nagios/etc/nagios.cfg: line 1144: `illegal_macro_output_chars=`~$&|’”‘

        Reply
  14. Dear Sir,

    Thank you for information. Please share information about how to add hosts and it’s respective services in Nagios latest version.

    Reply
  15. All installation steps goes fine.

    When I execute command systemctl enable nagios it shows error.

    Failed to execute operation: Access denied

    please help as soon as possible.

    Reply
    • @Agust,

      Do a yum update, hope it will upgrade your Nagios version to most recent available version from repositories. Else, do a source installation for the latest version of Nagios.

      Reply
  16. Hello Sir,

    I followed all steps you gave, but I’m unable to login web-interface, see below error.

    # curl -k http://172.25.9.11/nagios/
    
    Sample Output
    401 Unauthorized
    
    Unauthorized
    This server could not verify that you
    are authorized to access the document
    requested.  Either you supplied the wrong
    credentials (e.g., bad password), or your
    browser doesn't understand how to supply
    the credentials required.
    
    Reply
  17. Hi, follow your guide for intsall nagios, i have a RHEL 7.3 Kernel 3.1, Nagios Core 4.2.4 and plugins 2.2.0, all work very good, but when i run at script at shell:

    [Server1]# ./check_hitachi.sh -H xx.xxx.xx.xx -C public
    OK - [Model : VSP, S/N : 94162, Mcode info : "70-06-40-00/00"]
     OK - Status is NORMAL [DKC_HW_PROCESSOR]
     OK - Status is NORMAL [DKC_HW_CACHE]
     OK - Status is NORMAL [DKC_HW_POWERSUPPLY]
     OK - Status is NORMAL [DKC_HW_BATTERY]
     OK - Status is NORMAL [DKC_HW_FAN]
     OK - Status is NORMAL [DKU_HW_POWERSUPPLY]
     OK - Status is NORMAL [DKU_HW_FAN]
     OK - Status is NORMAL [DKU_HW_Drive]
    

    All work fine, but in the GUI of Nagios, send me the next error:

    Storage94121 SNMP_VSP
    CRITICAL 05-10-2017 12:30:28 0d 13h 1m 43s 4/4 Critical - Problem with connection SNMP on device.

    Please, could you help me…..

    Reply
  18. Dear Sir,

    When I used # make install-webconf then I face a error
    make: No rule to make target ‘install-webconf Stop
    Please write me about this issue

    Reply
  19. Hello Team ,
    I have follow all the procedure my site is unreachable 35.154.196.36/nagios , i have check all my http, nagios services are running fine

    Kindly revert

    Reply
  20. On my CentOS 7.2 I still had an issue even after setting the said SELinux security context.

    Following SELinux security context worked for me !!

    # chcon -R -t httpd_sys_script_exec_t /usr/local/nagios/sbin
    
    Reply
  21. After try to resolve the issue the below is what I got. I believe it is a permission it issue but I don’t know where to put the permission

    Forbidden

    You don’t have permission to access /nagios/ on this server.

    Reply
    • @Larry,

      It’s something SELinux preventing from the accessing the nagios page, try to set SELinux to permissive mode, you can use the following command to set:

      # chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
      # chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
      

      Don’t forget to restart the Apache service..

      Reply
  22. This my error_log but cannot figure out what actually wrong with it, I will appreciate if you can help. Thanks

    [root@walezo httpd]# cat error_log
    [Mon Feb 06 22:31:35.777032 2017] [core:notice] [pid 64994] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
    [Mon Feb 06 22:31:35.791633 2017] [suexec:notice] [pid 64994] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
    [Mon Feb 06 22:31:35.830763 2017] [auth_digest:notice] [pid 64994] AH01757: generating secret for digest authentication ...
    [Mon Feb 06 22:31:35.832204 2017] [lbmethod_heartbeat:notice] [pid 64994] AH02282: No slotmem from mod_heartmonitor
    [Mon Feb 06 22:31:36.237038 2017] [mpm_prefork:notice] [pid 64994] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
    [Mon Feb 06 22:31:36.237134 2017] [core:notice] [pid 64994] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Mon Feb 06 22:32:07.907357 2017] [authn_file:error] [pid 64998] (2)No such file or directory: [client 192.168.80.1:59572] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 22:33:16.880750 2017] [authn_file:error] [pid 64996] (2)No such file or directory: [client 192.168.80.1:59592] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 23:02:55.957411 2017] [authn_file:error] [pid 64997] (2)No such file or directory: [client 192.168.80.1:60862] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 23:03:10.837134 2017] [authn_file:error] [pid 64998] (2)No such file or directory: [client 192.168.80.1:60951] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 23:04:52.027246 2017] [authn_file:error] [pid 64996] (2)No such file or directory: [client 192.168.80.1:61073] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 23:05:15.447494 2017] [authn_file:error] [pid 64997] (2)No such file or directory: [client 192.168.80.1:61084] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Mon Feb 06 23:21:22.964409 2017] [mpm_prefork:notice] [pid 64994] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Feb 06 23:21:25.406106 2017] [core:notice] [pid 65963] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
    [Mon Feb 06 23:21:25.445137 2017] [suexec:notice] [pid 65963] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
    [Mon Feb 06 23:21:25.486438 2017] [auth_digest:notice] [pid 65963] AH01757: generating secret for digest authentication ...
    [Mon Feb 06 23:21:25.487623 2017] [lbmethod_heartbeat:notice] [pid 65963] AH02282: No slotmem from mod_heartmonitor
    [Mon Feb 06 23:21:25.586846 2017] [mpm_prefork:notice] [pid 65963] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
    [Mon Feb 06 23:21:25.586897 2017] [core:notice] [pid 65963] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Mon Feb 06 23:22:00.473180 2017] [authn_file:error] [pid 65966] (2)No such file or directory: [client 192.168.80.1:61428] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 14:24:57.740080 2017] [core:notice] [pid 1434] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
    [Tue Feb 07 14:24:57.850559 2017] [suexec:notice] [pid 1434] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
    [Tue Feb 07 14:24:58.142777 2017] [auth_digest:notice] [pid 1434] AH01757: generating secret for digest authentication ...
    [Tue Feb 07 14:24:58.154676 2017] [lbmethod_heartbeat:notice] [pid 1434] AH02282: No slotmem from mod_heartmonitor
    [Tue Feb 07 14:24:58.827323 2017] [mpm_prefork:notice] [pid 1434] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
    [Tue Feb 07 14:24:58.827376 2017] [core:notice] [pid 1434] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Tue Feb 07 14:43:05.115516 2017] [authn_file:error] [pid 1918] (2)No such file or directory: [client 192.168.80.1:54213] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 20:39:40.185943 2017] [authn_file:error] [pid 3983] (2)No such file or directory: [client 192.168.80.1:57152] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 20:51:43.842652 2017] [authn_file:error] [pid 1918] (2)No such file or directory: [client 192.168.80.1:57645] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 20:51:50.062736 2017] [authn_file:error] [pid 1926] (2)No such file or directory: [client 192.168.80.1:57646] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 20:51:53.314295 2017] [authn_file:error] [pid 1922] (2)No such file or directory: [client 192.168.80.1:57647] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Tue Feb 07 20:51:54.588580 2017] [authn_file:error] [pid 3983] (2)No such file or directory: [client 192.168.80.1:57648] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 07:51:55.884658 2017] [authn_file:error] [pid 1918] (2)No such file or directory: [client 192.168.80.1:63897] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 07:52:12.989534 2017] [authn_file:error] [pid 1926] (2)No such file or directory: [client 192.168.80.1:63903] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 08:05:09.656638 2017] [authn_file:error] [pid 3983] (2)No such file or directory: [client 192.168.80.1:64248] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 08:05:28.998158 2017] [autoindex:error] [pid 1918] [client 192.168.80.1:64256] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
    [Wed Feb 08 08:05:44.772814 2017] [authn_file:error] [pid 3983] (2)No such file or directory: [client 192.168.80.1:64262] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 09:38:29.962351 2017] [authn_file:error] [pid 10500] (2)No such file or directory: [client 192.168.80.1:49660] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 10:09:07.870433 2017] [authn_file:error] [pid 1918] (2)No such file or directory: [client 192.168.80.1:50066] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 10:09:12.156522 2017] [authn_file:error] [pid 1922] (2)No such file or directory: [client 192.168.80.1:50069] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 10:09:20.490700 2017] [autoindex:error] [pid 10500] [client 192.168.80.1:50074] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
    [Wed Feb 08 10:15:31.865684 2017] [mpm_prefork:notice] [pid 1434] AH00170: caught SIGWINCH, shutting down gracefully
    [Wed Feb 08 10:17:40.443778 2017] [core:notice] [pid 1433] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
    [Wed Feb 08 10:17:40.458947 2017] [suexec:notice] [pid 1433] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Wed Feb 08 10:17:40.780444 2017] [auth_digest:notice] [pid 1433] AH01757: generating secret for digest authentication ...
    [Wed Feb 08 10:17:40.781677 2017] [lbmethod_heartbeat:notice] [pid 1433] AH02282: No slotmem from mod_heartmonitor
    [Wed Feb 08 10:17:42.087364 2017] [mpm_prefork:notice] [pid 1433] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
    [Wed Feb 08 10:17:42.087433 2017] [core:notice] [pid 1433] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Wed Feb 08 10:26:13.078998 2017] [authn_file:error] [pid 1955] (2)No such file or directory: [client 192.168.80.1:50277] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 10:29:14.590713 2017] [autoindex:error] [pid 1955] [client 192.168.80.1:50477] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
    [Wed Feb 08 10:29:24.180827 2017] [authn_file:error] [pid 3827] (2)No such file or directory: [client 192.168.80.1:50482] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [Wed Feb 08 10:38:53.622638 2017] [authn_file:error] [pid 3828] (2)No such file or directory: [client 192.168.80.1:51047] AH01620: Could not open password file: /usr/local/nagios/etc/htpasswd.users
    [root@walezo httpd]#

    Reply
  23. Thanks for you response,the configuration look okay
    Website: https://www.nagios.org
    Reading configuration data…
    Read main config file okay…
    Read object config files okay…

    Running pre-flight check on configuration data…

    Checking objects…
    Checked 8 services.
    Checked 1 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
    Checking for circular paths…
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
    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

    Reply
  24. Good day I install and configure Nagios and everything seems work fine when i start apache and nagios they both work but i can not access the web. the below was the error i got. I will appreciate if anybody can tell me what to do.Thanks

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Reply
    • @Larry,

      Check the apache logs for errors and fix them or try to verify the Nagios configuration and see if any errors throws it..

      Reply
    • Thanks for your response this what i found in my httpd log no issue discovered can you check if there is anything I have to do. Appreciate you effort

      [root@localhost httpd]# cat access_log
      192.168.80.1 - - [06/Feb/2017:22:31:46 -0800] "GET /nagios HTTP/1.1" 401 381 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:22:32:07 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - - [06/Feb/2017:22:32:08 -0800] "GET /favicon.ico HTTP/1.1" 404 209 "http://192.168.80.182/nagios" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:22:33:16 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:23:02:55 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:23:03:10 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:23:04:52 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - nagiosadmin [06/Feb/2017:23:05:15 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      ::1 - - [06/Feb/2017:23:21:23 -0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.4.16 (internal dummy connection)"
      192.168.80.1 - nagiosadmin [06/Feb/2017:23:22:00 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
      192.168.80.1 - - [07/Feb/2017:14:42:39 -0800] "GET /nagios HTTP/1.1" 401 381 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0"
      192.168.80.1 - nagiosadmin [07/Feb/2017:14:43:05 -0800] "GET /nagios HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0"
      192.168.80.1 - - [07/Feb/2017:14:43:05 -0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0"
      192.168.80.1 - - [07/Feb/2017:14:43:05 -0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0"
      [root@localhost httpd]#

      Reply
      • @Larry,

        Could you check the error log as well and also don’t forget to verify the Nagios configuration as shown:

        # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
        
        Reply
  25. I have installed Nagios successfully and also configured the same but when I am trying to start the service it’s not getting up.
    Below are the steps :

    [root@tech nagios]# service nagios restart
    Running configuration check...
    Stopping nagios:/etc/init.d/nagios: line 142: kill: (29604) - No such process
     done.
    Starting nagios: done.
    [root@tech nagios]# service nagios status
    nagios is not running
    
    Website: https://www.nagios.org
    Reading configuration data...
       Read main config file okay...
       Read object config files okay...
    
    Running pre-flight check on configuration data...
    
    Checking objects...
    	Checked 8 services.
    	Checked 1 hosts.
    	Checked 1 host groups.
    	Checked 0 service groups.
    	Checked 1 contacts.
    	Checked 1 contact groups.
    	Checked 24 commands.
    	Checked 5 time periods.
    	Checked 0 host escalations.
    	Checked 0 service escalations.
    Checking for circular paths...
    	Checked 1 hosts
    	Checked 0 service dependencies
    	Checked 0 host dependencies
    	Checked 5 timeperiods
    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-configuration check.

    Thanks in advance, Appreciate your help.

    Reply
    • @Faiz,

      Nagios configuration checks seems fine no errors, don’t know why its not showing as running status.. Could you restart the machine and see? and also confirm the space on the filesystem..

      Reply
  26. Thanks Ravi,
    I am installed the nagios core, and able to view all my windows host in same.

    I want to configure services for my host to check who is current login users and which are the running application or installed application in my host.
    can you please help me on same.

    Reply
  27. Hello Ravi,
    I thank you for this wonderful job.

    I’m facing one problem at the end of installation.

    While accessing the web interface it showing some error

    Error: could not read object file configuration data

    And it’s also shows not running message in home page.

    But the process is running fine in server

    Reply
    • @Vishnu,

      This is something permission issue, Apache user should able to access Nagios files, try setting the correct webserver user to the Nagios directory structure as shown:

      # chgrp -R apache:apache /var/log/nagios
      
      Reply
  28. Hi ravi,

    I have installed the redhat 6 in my virtual box and i did all step which u mentioned in the webpage.but still i am not able to connect nagios page. My IP is 192.168.56.101, When I gave the ip with /nagios its not viewing in the web page. I do know where is problem kindly help me.!

    Reply
    • @Sudhan,

      What error you getting while accessing the Nagios web page? also could you run the below command to verify the Nagios Configuration and post the output here?

      # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
      
      Reply
  29. Hi
    This is Anil kumar kalu and i configured Nagios with ZERO errors and finally all are over.
    but when i type in google chrome in my lapy like ” 192.168.16.3/nagios or http://192.168.16.3/nagios
    its showing

    “””’ Forbidden
    You don’t have permission to access /nagios/ on this server. Apache/2.2.15 (Red Hat) Server at 192.168.16.3 Port 80 “””””””

    so please help me and my os is windows-10 , vmware-08 , linux-RHEL-06.
    i will wait for your feed back.
    Thank you.

    Reply
  30. Hi,

    I followed the installation procedure and seems to be running without any errors, but when trying to access from browser [chrome] – it asks for username and password and then the browser throws “ERR_CONNECTION_ABORTED”.

    Can you help me with identifying the issue please.?..

    Notes:
    – Nagios credentials are verified
    – /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg has zero warning/errors
    – URL: http:///nagios
    – http:// opens as a default Apache Welcome Page, no errors here!

    On the server:
    – #service nagios status
    nagios (pid 22576 22575 22574 22573 22572 22570 2449 2366 2365 2364 2363 2357) is running…
    – #service httpd status
    httpd (pid 22611) is running…
    – # iptables -L -n | grep 80
    ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

    Reply
    • @Bharath,

      It something related to your Windows chrome issue, try to open the Nagios using other browser such as Firefox or Opera and see..

      Reply
      • Thanks for responding Ravi,

        I tried the same with IE (v11) and Firefox (v45.2.0), but here http://IP/nagios fails to ask for username/password.
        But Apache default page works in all browsers, so kind of stuck with figuring out if this is a browser/client or server issue.

        Error:
        Page cant be displayed [IE] or Connection error [Firefox]

        Can I debug the connection on Nagios Server or check if the requests are hitting it..?

        Reply
      • Thanks for responding Ravi,

        I tried accessing the same from IE[v11] and Firefox[v45.2.0] but it fails to ask Nagios credentials.
        Whereas in Chrome [incognito mode], it asks for nagios credentials but then fails to open the webpage.

        Is there a way i can debug this issue?
        As i am not sure if this is a browser/client or server side config issue.

        Reply
      • Thanks,

        It worked on local using command line [lynx] with authentication.
        So, as you mentioned it should be an issue with client/browser.

        Reply
        • @Bharath,

          Yes, the issue with your client machine or browser, try to check the Nagios web from other machine with different OS or browser..

          Reply
  31. Hi team,

    I had followed all the steps and done without any errorr but the issue i am facing is not able to open the page . please help

    Reply
  32. Failed to start LSB : start and stop Nagios Monitoring Server
    What is this and how can I recover from this problem .

    Reply
    • @Rasel,

      Try to run the following command to check the nagios configuration, if its gives Output that means you can able to start Nagios, or check nagios.cfg file for any errors.

      # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
      
      Reply
      • I will check it but there haven’t any problem. I get this report.

        Total Warnings: 0
        Total Errors: 0

        when I type
        #systemctl start nagios.service
        and waiting for long time but can’t get any reply. That’s mean nagios service not working.

        Reply
        • @Rasel,

          That means your nagios setup is perfectly installed and configured, its seems the issue with service itself, let me check and get back to you with solution.

          Reply
    • @Laskura,

      Yes, that’s the default URL to access Nagios, have you getting any errors on the page? could you share with us so that I can help you out..

      Reply
  33. Great tutorial , congrats ! I encountered a small issue because my Centos was not having zip and unzip. Could you please add them in the first step ? If they are already in the system, no harm. If not they will be installed and maybe other users won’t spent time undestanding why nagios is not available as context in Apache.

    Cheers.

    Reply
    • @Marian,

      Thanks for the tip, yes, I will surely add those two dependency packages in the requirement section, so that newbies don’t need to face any issues while compiling the Nagios..

      Reply
  34. how to solve this
    [root@centos ~]# chkconfig –add httpd
    error reading information on service httpd: No such file or directory
    everything other work as expect

    Reply
    • @Glitter,

      First find out Apache with locate httpd command and then restart the Apache service, and make sure its running with httpd -S command.

      # locate httpd 
      # service httpd restart
      # httpd -S
      
      Reply
  35. i have problem while install this below package ? how to resolve this ??

    Error: Package: gd-last-devel-2.1.1-2.el7.remi.x86_64 (remi)
    Requires: libvpx-devel(x86-64)
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    THIS ARE THE REPOLIST ALL IS ENABLED

    InstallMedia RHEL-7.0 Server.x86_64 disabled
    epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 enabled: 9,570
    epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 – Debug enabled: 2,138
    epel-source/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 – Source enabled: 0
    epel-testing/x86_64 Extra Packages for Enterprise Linux 7 – Testing – x86_64 enabled: 846
    epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 – Testing – x86_64 – Debu enabled: 142
    epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 – Testing – x86_64 – Sour enabled: 0
    ius/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 enabled: 198
    ius-archive/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Archiv enabled: 1,517
    ius-archive-debuginfo/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Archiv enabled: 105
    ius-archive-source IUS Community Packages for Enterprise Linux 7 – x86_64 – Archiv enabled: 0
    ius-debuginfo/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Debug enabled: 31
    ius-dev/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Dev enabled: 8
    ius-dev-debuginfo/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Dev De enabled: 4
    ius-dev-source IUS Community Packages for Enterprise Linux 7 – x86_64 – Dev So enabled: 0
    ius-source IUS Community Packages for Enterprise Linux 7 – x86_64 – Source enabled: 0
    ius-testing/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Testin enabled: 204
    ius-testing-debuginfo/x86_64 IUS Community Packages for Enterprise Linux 7 – x86_64 – Testin enabled: 21
    ius-testing-source IUS Community Packages for Enterprise Linux 7 – x86_64 – Testin enabled: 0
    remi Remi’s RPM repository for Enterprise Linux 7 – x86_64 enabled: 2,740
    remi-debuginfo/x86_64 Remi’s RPM repository for Enterprise Linux 7 – x86_64 – debugin enabled: 1,061
    remi-php55 Remi’s PHP 5.5 RPM repository for Enterprise Linux 7 – x86_64 enabled: 347
    remi-php55-debuginfo/x86_64 Remi’s PHP 5.5 RPM repository for Enterprise Linux 7 – x86_64 – enabled: 237
    remi-php56 Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 – x86_64 enabled: 347
    remi-php56-debuginfo/x86_64 Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 – x86_64 – enabled: 236
    remi-php70 Remi’s PHP 7.0 RPM repository for Enterprise Linux 7 – x86_64 enabled: 223
    remi-php70-debuginfo/x86_64 Remi’s PHP 7.0 RPM repository for Enterprise Linux 7 – x86_64 – enabled: 131
    remi-php70-test Remi’s PHP 7.0 test RPM repository for Enterprise Linux 7 – x86 enabled: 75
    remi-php70-test-debuginfo/x86_64 Remi’s PHP 7.0 test RPM repository for Enterprise Linux 7 – x86 enabled: 5
    remi-safe Safe Remi’s RPM repository for Enterprise Linux 7 – x86_64 enabled: 735
    remi-test Remi’s test RPM repository for Enterprise Linux 7 – x86_64 enabled: 575
    remi-test-debuginfo/x86_64 Remi’s test RPM repository for Enterprise Linux 7 – x86_64 – de enabled: 184
    rhel7 rhel7 enabled: 4,305
    rpmforge RHEL 7Server – RPMforge.net – dag enabled: 245
    rpmforge-extras RHEL 7Server – RPMforge.net – extras enabled: 10
    rpmforge-testing RHEL 7Server – RPMforge.net – testing enabled: 4
    webtatic/x86_64 Webtatic Repository EL7 – x86_64 enabled: 178
    webtatic-archive/x86_64 Webtatic Repository EL7 – x86_64 – Archive enabled: 2,607
    webtatic-archive-debuginfo/x86_64 Webtatic Repository EL7 – x86_64 – Archive Debug enabled: 105
    webtatic-archive-source Webtatic Repository EL7 – x86_64 – Archive Source enabled: 0
    webtatic-debuginfo/x86_64 Webtatic Repository EL7 – x86_64 – Debug enabled: 39
    webtatic-source Webtatic Repository EL7 – x86_64 – Source enabled: 0
    webtatic-testing/x86_64 Webtatic Repository EL7 – x86_64 – Testing enabled: 100
    webtatic-testing-debuginfo/x86_64 Webtatic Repository EL7 – x86_64 – Testing Debug enabled: 6
    webtatic-testing-source Webtatic Repository EL7 – x86_64 – Testing Source enabled: 0
    repolist: 29,279

    Reply
    • @ckrhel,

      Oh man, you’ve so many third-party repositories enabled on the system, try to disable all and install from default system repositories to get rid of conflicts..

      Reply
  36. i done everthing done as per above steps ..starting services taking to much time it doesnt start the services ,
    i tired to login http://ip/nagios it doesnt works
    here the below settings
    plz reslove this problem

    systemctl status nagios.service
    nagios.service – LSB: start and stop Nagios monitoring server
    Loaded: loaded (/etc/rc.d/init.d/nagios)
    Active: activating (start) since Mon 2016-03-07 13:05:12 EST; 14s ago
    Process: 3287 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)
    CGroup: /system.slice/nagios.service
    ├─2657 /usr/local/nagios/bin/nagios -ud /usr/local/nagios/etc/nagios.cfg
    ├─2661 /usr/local/nagios/bin/nagios –worker /usr/local/nagios/var/rw/nagios.qh
    ├─2662 /usr/local/nagios/bin/nagios –worker /usr/local/nagios/var/rw/nagios.qh
    ├─2663 /usr/local/nagios/bin/nagios –worker /usr/local/nagios/var/rw/nagios.qh
    ├─2664 /usr/local/nagios/bin/nagios –worker /usr/local/nagios/var/rw/nagios.qh
    └─2672 /usr/local/nagios/bin/nagios -ud /usr/local/nagios/etc/nagios.cfg

    Mar 07 13:05:12 redhat1.red.com systemd[1]: Starting LSB: start and stop Nagios monitoring server…
    Mar 07 13:05:12 redhat1.red.com nagios[3287]: nagios (pid 2672 2664 2663 2662 2661 2657) is running…
    Mar 07 13:05:12 redhat1.red.com systemd[1]: PID file /var/nagios/nagios.pid not readable (yet?) after start.

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

    Nagios Core 4.0.1
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 10-15-2013
    License: GPL

    Website: http://www.nagios.org
    Reading configuration data…
    Read main config file okay…
    Read object config files okay…

    Running pre-flight check on configuration data…

    Checking objects…
    Checked 8 services.
    Checked 1 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
    Checking for circular paths…
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
    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

    systemctl status httpd
    httpd.service – The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
    Active: active (running) since Mon 2016-03-07 10:40:06 EST; 1h 53min ago
    Main PID: 5059 (httpd)
    Status: “Total requests: 3; Current requests/sec: 0; Current traffic: 0 B/sec”
    CGroup: /system.slice/httpd.service
    ├─5059 /usr/sbin/httpd -DFOREGROUND
    ├─5060 /usr/libexec/nss_pcache 327683 off /etc/httpd/alias
    ├─5061 /usr/sbin/httpd -DFOREGROUND
    ├─5062 /usr/sbin/httpd -DFOREGROUND
    ├─5063 /usr/sbin/httpd -DFOREGROUND
    ├─5064 /usr/sbin/httpd -DFOREGROUND
    ├─5065 /usr/sbin/httpd -DFOREGROUND
    └─5220 /usr/sbin/httpd -DFOREGROUND

    Mar 07 10:40:02 redhat1.red.com systemd[1]: Starting The Apache HTTP Server…
    Mar 07 10:40:06 redhat1.red.com systemd[1]: Started The Apache HTTP Server.
    Mar 07 12:27:50 redhat1.red.com systemd[1]: Started The Apache HTTP Server.

    Reply
    • @ck,

      Have you gone through the article? the instructions clearly stated in this article, that the Nagios can be installed as normal user i.e. nagios user..

      Reply
  37. I have completed all steps and when when verified i am getting zero erors but when i tried to start nagios with ” service nagios start” it is taking so much time to execute and finally failing by giving timed out error. I am unabble to find the reason (I am doing his on rhel 7)

    Reply
  38. hi i installed nagios following this tutorial successfully but i m having problem to connect the webinterface.please help
    thanks in advance

    Reply
    • @Ali,

      May I know the what problem you’re facing while accessing the Nagios web interface? could you share the error or any screenshot with us?

      Reply
  39. Hi,

    can you please help me out to start nagios services , I am getting this error after finished all the above step sucessfully.

    [root@localhost nagios]# chkconfig –add httpd
    error reading information on service httpd: No such file or directory

    [root@localhost nagios]# systemctl status httpd
    httpd.service – The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
    Active: active (running) since Fri 2015-12-18 21:53:21 IST; 22min ago
    Main PID: 3784 (httpd)
    Status: “Total requests: 5; Current requests/sec: 0; Current traffic: 0 B/sec”
    CGroup: /system.slice/httpd.service
    ├─3784 /usr/sbin/httpd -DFOREGROUND
    ├─3785 /usr/sbin/httpd -DFOREGROUND
    ├─3786 /usr/sbin/httpd -DFOREGROUND
    ├─3787 /usr/sbin/httpd -DFOREGROUND
    ├─3788 /usr/sbin/httpd -DFOREGROUND
    └─3789 /usr/sbin/httpd -DFOREGROUND

    Dec 18 21:53:21 localhost.localdomain httpd[3784]: AH00558: httpd: Could not reliably determine the server’s fully qualified dom…essage
    Dec 18 21:53:21 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
    Hint: Some lines were ellipsized, use -l to show in full.
    [root@localhost nagios]# chkconfig

    Note: This output shows SysV services only and does not include native
    systemd services. SysV configuration data might be overridden by native
    systemd configuration.

    If you want to list systemd services use ‘systemctl list-unit-files’.
    To see services enabled on particular target use
    ‘systemctl list-dependencies [target]’.

    iprdump 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    iprinit 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    iprupdate 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    nagios 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    rhnsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    [root@localhost nagios]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

    Nagios Core 4.0.1
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 10-15-2013
    License: GPL

    Website: http://www.nagios.org
    Reading configuration data…
    Read main config file okay…
    Read object config files okay…

    Running pre-flight check on configuration data…

    Checking objects…
    Checked 8 services.
    Checked 1 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
    Checking for circular paths…
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
    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

    Reply
  40. Hi
    Thank you for the great tutorial! Everything works fine for me and nagios is running!
    I am just facing one problem, as I am new to Linux: I wanted to install a check_mem plugin on the local host from exchange.nagios.org. Can you tell me which files I have to modify to get the plugin working?

    Reply
    • @Amel,
      Thanks for the kind words and I am happy that you found this article useful. About check_mem plugin I never tried it but will definitely provide a instructions on the same, just give me a day or two..

      Reply
  41. Hi Ravi … Thanks for this website. I have configured Nagios but when access it from web (http://locahost/nagios) and put credential it gives following error.

    Forbidden
    You don’t have permission to access /nagios/ on this server.

    Reply
  42. The requested URL /nagios/ was not found on this server.
    Apache/2.2.15 (CentOS) Server at 10.0.0.198 Port 80

    I followed your instruction it goes smoothly but when i am trying to access it give above error.
    could you please help me out?

    Thanks In Advance :)

    Reply
    • @Shailesh,
      Sorry, but your installation was not successful, please try again…or if you feels your installation was perfect then try to disable SELinux and try again.

      Reply
      • thank you !!
        I have server all the process working fine in the nagios as well as server.
        but there is one issue in the nagios web browser,Total Process WARNING System call sent warnings to stderr: ERROR: Unsupported option (BSD syntax) .
        pa command working fine.
        could you please help me?

        Thank in advance

        Reply
          • @Ravi,
            i am getting this error on CentOS 6.5. both server Nagios and Server On Centos 6.5.all server working properly but sudden getting this error.
            Thanks in Advance

          • @Shailesh,

            Could you please tell us or post here the exact error you getting about Nagios? so that we can better help you out..

          • @Ravi,
            The Error is “Total Process WARNING System call sent warnings to stderr:ERROR: Unsupported option (BSD syntax) ” on Nagios Dashboard(web browser).

          • @Shailesh,

            Okay thanks for mentioning the exact error, here is the solution to fix, just re-install the following package. I hope it will fix your error and don’t forget to restart Nagios.

            # yum reinstall procps
            
          • @Ravi,
            I have tried.
            # yum reinstall procps
            Loaded plugins: fastestmirror, refresh-packagekit, security
            Setting up Reinstall Process
            Determining fastest mirrors
            epel/metalink | 3.9 kB 00:00
            * base: centos.excellmedia.net
            * epel: mirror.wanxp.id
            * extras: centos.excellmedia.net
            * remi-safe: mirrors.thzhost.com
            * updates: centos.excellmedia.net
            * webtatic: sp.repo.webtatic.com
            base | 3.7 kB 00:00
            epel | 4.3 kB 00:00
            epel/primary_db | 5.7 MB 00:09
            extras | 2.9 kB 00:00
            extras/primary_db | 33 kB 00:00
            remi-safe | 2.9 kB 00:00
            remi-safe/primary_db | 226 kB 00:00
            updates | 3.4 kB 00:00
            updates/primary_db | 3.2 MB 00:07
            webtatic | 3.6 kB 00:00
            webtatic/primary_db | 170 kB 00:00
            Installed package procps-3.2.8-25.el6.x86_64 (from anaconda-CentOS-201311272149.x86_64) not available.
            Error: Nothing to do

            But still problem is same.
            i have tried on both server as well as nagios server.

          • @Shailesh,

            Sorry to hear, it would be possible for you to provide me a access to server so that I can dig out and resolve nagios error.

  43. Hey Hi and thx for such and awesome upload…

    I just followed the guide.. Knows nothing about Linux but having issues with my hosting server so i wanted to get this thing done.. everything went as you showed in you sample but when i`m trying to open it, its showing me a 404 Error page..
    [Note: I`m not accessing it locally but have a live ip and our server is on some remote location. so don’t know, if i need to do some tweaks with iptables as well.. need your guidance on that.]

    Thanks in advance..!!

    Reply
    • @Zohaib,
      Can you try to access it locally at localhost and see whether its opening or not? secondly can you verify the nagios configuration using following command.

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

      Please post the output here..

      Reply
      • Reading main config file okay…
        Error: Unexpected start of object definition in file ‘/usr/local/nagios/etc/objects/contacts.cfg on line 49. Make sure you close preceding objects before starting a new one.
        Error processing object config files!

        ***> One or more problems was encountered while processing the config files…

        Check your configuration file(s) to ensure that they contain valid directives and data definitions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the ‘Whats New’ section to find out what has changed.

        That was typed word for word so there may be some typos. I have run through the contacts.cfg but don’t see anything that stands out. I even counted down to line 49. I am setting this up on a virtual environment using virtualbox on my home pc to understand the monitoring world. Thank you for your assistance.

        Reply
  44. I have followed your instructions and installed nagios even though some libraries are missing on my localhost.

    Do you have instructions for installing Nagios NRPE and monitoring remote service via nagios web page.

    Thanks alot:)

    Reply
  45. Hi,

    I follow the steps in installing nagios on centos, the installation go smoothly. but when i try to access the web interface it shows “This webpage is not available ERR_CONNECTION_TIMED_OUT”. I disabled the selinux the restart both httpd and nagios service but still having same error.

    Please Help. Thanks

    Reply
    • @Rajan,
      Sorry we haven’t covered that topic so far, but we are in process to soon post a topic that shows how to add Network devices, switches and printers to Nagios monitoring Server. Stay tuned for updates..

      Reply
  46. Well this is how things ought to be simple and straight forward, awesome I followed all the steps and my nagios is working just fine. Thank you!!

    Reply
  47. Simple and awesome. followed all steps and configured without any issue.
    Thanks for making it so simple yet useful.

    Reply
  48. Had the same problem Internal Server Error, issue the following command to fix it.

    # chcon httpd_sys_content_t -R -t /usr/local/nagios
    
    Reply
    • @Bhimraya,
      Disable Selinux or set correct selinux rules on nagios..just go through the comments you will find solution for this error..

      Reply
  49. Hi there! Im a complete ignorant about Linux, Im just follow instructions xD.
    But in step “Configure Nagios Core” I have troubles with the ./configure command, its says “no such file or directory”. And I dont know how to use it.
    Can you helpme please!
    Thanks!

    Reply
  50. Hi,

    I installed Nagios and it is working fine on my local virtual machine but when I tried to install it on my server I have problems because it has to go over https and not http. Can you help me how to set it up?

    Thank you.

    Reply
  51. Hi, Thanks for the tutorial.
    I have followed all the instructions and cant login to Nagios Web Interface
    I didnt have any problem installing the nagios or configuring,
    Only problem I am having while entering user and password, the window is popping up again asking user and password.

    Reply
  52. I followed this guide and was able to get a working installation; however some how the check_snmp plugin is missing. I verified that net-snmp is in fact installed.

    Reply
  53. I followed this tutorial and I get the web interface on the system but when I click the hosts link on the left I get the following error in my browser:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    I did see this in the error_log of the httpd logs

    (13)Permission denied: exec of ‘/usr/local/nagios/sbin/status.cgi’

    Reply
  54. Hi all,

    I am having prob in Nagios 4.0.1 installation over CentOS6.6. I followed above steps carefully however installing and configuring Nagios Web interface using “make install-webconf” giving me following error.

    [root@localhost nagios-plugins-1.5]# make install-webconf
    make: *** No rule to make target `install-webconf’. Stop.

    I really new to Linux, any suggestion and help appriciated. Thank you.

    Reply
  55. Hi Ravi,

    Do we have any documents or steps to setup Linux and Windows server logs monitoring in Nagios ?

    -Jonus Joseph

    Reply
  56. hello,
    i have installed nagios 4 on openstack in centOs7.
    i have tried the following command:

    sudo packstack –answer-file=packstack-answers-20141218-125821.txt

    Nagios is running, but i m getting error as :

    Error: Could not read object configuration data!

    Here are some things you should check in order to resolve this error:

    Verify configuration options using the -v command-line option to check for errors.
    Check the Nagios log file for messages relating to startup or status data errors.

    Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.

    What should I do?

    Reply
  57. Hi ,
    When i use this cmd ” /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg ” . i am getting error : -bash: /usr/local/nagios/bin/nagios: No such file or directory

    Is there anything i am missing . If i restart the nagios service , i am getting : stop as status .
    Any info will help . Thanks in Advance .

    Reply
  58. Hi Ravi,

    Can i get any documentation/steps for Nagios graph(pnp4nagios) installation and configuration in RHEL6 ?
    I am finding lots of difficulty while installing and configuring pnp4nagios .

    Thanks in advance.

    -Jonus Joseph

    Reply
    • @Jonus,
      Sorry, but presently we don’t have any docs for the pnp4nagios, but we will try to cover the topic soon..stay tuned for this..

      Reply
  59. Hi All,
    I am able to launch nagios web-interface using server ip but i am getting “Internal Server Error” when i tried accessing hosts,servicse etc.
    Many thanks.Please help.

    Reply
      • Hi Ravi,
        I was also facing the same issue that Hemanth was facing & so i tried the command that you told & it worked . But i wanted to know what was wrong before & what changes happend after the command.

        Reply
    • @Gursharan,
      Yes, you correct apache user created by httpd package, once you install this apache user and group are created..

      Reply
  60. I’ve installed Nagios 4.0.8 on CentOS 6.6 and keep getting these error messages on certain checks:

    (No output on stdout) stderr: Can’t locate Nagios/Plugin/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)

    (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    Any suggestions?

    Reply
    • @Tom,
      Seems your Nagios 4.0.8 installation was not succeed, the error clearly indicating that the plugin is missing..try to follow instructions again..

      Reply
  61. I had Follow your artificial,but when we trying to access that server url we found below error please help

    Not Found

    The requested URL /nagios was not found on this server.

    Apache/2.2.15 (CentOS) Server at 192.168.0.5 Port 80

    Reply
  62. @Ravi Saive: thanks for your reply. I followed your tutorial and successfull but now i want to confirguration nagios run under apache virtual host on my centos server.
    Any ideas what can i do?

    Reply
    • @Tung,
      Yes you can run Nagios under Vhosts, just use our search form to search for articles on apache virtual host..there would be plenty..

      Reply
      • I fowllow your tutorial and Nagios worked at xxx.xxx.xxx.xxx/nagios but i want to access Nagios when i browse http://xxx.xxx.xxx.xxx.

        I edited /etc/httpd/conf.d/nagios.conf and when i restart apache and it display

        [Fri Dec 26 17:43:11 2014] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 553 will probably never match because it overlaps an earlier Alias.
        [Fri Dec 26 17:43:11 2014] [warn] The ScriptAlias directive in /etc/httpd/conf/httpd.conf at line 578 will probably never match because it overlaps an earlier ScriptAlias.
        [Fri Dec 26 17:43:11 2014] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 857 will probably never match because it overlaps an earlier Alias.

        Can you help me? please

        Reply
        • @Tung,
          Where and what you’ve edited in httpd.conf file, can you post here..so that I can help you out with proper configuration..

          Reply
          • @Ravi Saive.

            As i said i want to access Nagios via http://my-ip/ so I edit in my /etc/httpd/conf.d/nagios.conf.

            Here is content of nagios.conf file:

            ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin” >>>> And i am not sure about this line???

            # 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 /usr/local/nagios/etc/htpasswd.users
            Require valid-user

            Alias / “/usr/local/nagios/share” >>>> i changed here

            # 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 /usr/local/nagios/etc/htpasswd.users
            Require valid-user

            Finally i save this file and restart httpd service. But disappear this error.

          • @Ravi Saive.

            No whe i browse via IP it display:

            Forbidden

            You don’t have permission to access / on this server.

            Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

            Any ideas what can i do?

  63. Hi Ravi,

    I went through all the steps & i have configured Nagios on rhel 6 with the help of above steps given by you but when i tried to install Nagios for the third time on my rhel6 while trying to login it’s showing authentication failure, then i have reinstalled my system again tried, went through all the steps but still getting that authentication error. Can you please tell me where i’m making the mistake…

    Thank You…

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.