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 thoughts on “How to Install Nagios Monitoring in RHEL, Rocky, and AlmaLinux”

  1. When I run the ‘make all‘ command, the console shows the ‘make: *** No rule to make target ‘all’. Stop.

    How can I solve this problem?

    Reply
  2. Hi, I am trying to test it on an AWS Ec2 instance, at step 10, it’s not working. I have opened all the security groups also.

    When entering only my Pub IP in the browser, it’s loading to a web-page, but not with /nagios, below error I am seeing,

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

    Thanks

    Reply
  3. There is one step is missing in the above guide. You need to add the port 80 in the firewall otherwise you unable to access it via web console.

    # firewall-cmd --zone=public --add-port=80/tcp --permanent
    # firewall-cmd --reload
    
    Reply
  4. Hi, unable to add Nagios (step 9) after verifying the Nagios configuration files. Got the error Failed to issue method call: No such file or directory.

    Reply
    • The first time is also stuck with the same error then I found that you can use the second screenshot commands in STEP 9.

      I was successfully complete the configuration with below mentioned commands in step 9

      [root@tecmint ]# systemctl enable nagios
      [root@tecmint ]# systemctl enable httpd
      

      Restart Nagios to make the new settings take effect.

      [root@tecmint ]# service nagios start              [On RHEL/CentOS 6]
      [root@tecmint ]# systemctl start nagios.service    [On RHEL/CentOS 7/8 and Fedora]
      
      Reply
  5. Hi Ravi,

    I am not able to login in to Nagios from my local network, outside of the VM machine. Would you please tell me where I need to allow please send me the code. thanks

    Reply
  6. When I visit “http://ip-addr“, I can see the page of Apache. But I visit “http://ip-addr/nagios“, I can not see anything.

    I don’t know where is the problem. Please tell me, thanks!

    Reply
  7. Did everything as above mentioned but getting the below error at the final Verification Nagios Configuration Files

    Website: https://www.nagios.org
    Reading configuration data…
    Read main config file okay…
    Error: Unexpected token or statement in file ‘/usr/local/nagios/etc/objects/contacts.cfg’ on line 22.
    Error processing object config files!

    Reply
  8. I followed the step above, yet I get the issue.

    Warning: Monitoring process may not be running! and “You don’t have permission to access /cgi-bin/ on this server.” the Nagios service is running everything seem ok. SElinux is set to permissive.

    I’m on CentOS7, Nagios-4.4.3

    Any idea,

    Reply
      • Thanks for reply. Yet, disable SElinux still got the same error. To produce the error, access Nagios via FQDN.com (nagios.mydomain.com) Anyways, access via ipaddress/nagios working fine . I thought it is the apache configuration issue.

        Note: I did VHOST the this server.

        Reply
        • Solved by vim /etc/httpd/conf/httpd.conf then specify the script alias>> ScriptAlias /cgi-bin/ "/usr/local/nagios/sbin/".

          Reply
  9. Got an error while running this command ./configure --with-command-group=nagcmd.

    I also executed this command to resolve :

    # yum install -y gcc glibc glibc-common wget unzip httpd php gd gd-devel perl postfix
    
    Reply
  10. Please help !!!

    When i issue command “systemctl enable nagios“, I got following errors.

    [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
  11. I have added windows machine. I am unable to monitor the client windows machine. I am getting below. Please help me on this.

    connect to address 172.24.120.78 and port 12489: Connection refused

    Reply
  12. 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
  13. # 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. @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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. Dear Sir,

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

    Reply
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. 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
  53. 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.

  54. 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
  55. 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
  56. 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
  57. 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
  58. Simple and awesome. followed all steps and configured without any issue.
    Thanks for making it so simple yet useful.

    Reply
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. Hi Ravi,

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

    -Jonus Joseph

    Reply
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. @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?

  74. 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
  75. hi Ravi

    i just end to install nagios 4.0.8, and i don’t know the way to configure my first host! please can you help me to do that! i need to finish all this installation, it for my degree! sorry for my english, am a french-girl!
    tkx

    Reply
    • Dear Kyra,

      I’ve already included instructions on how to add first host to Nagios in this article, please follow the guide properly. Still any help you can contact me directly using our contact us page.

      Reply
  76. When I get to the compilatio and input “make all” I get this error: “make[1]: *** No rule to make target `../include/locations.h’, needed by ‘nagios.o’. Stop.” I have followed these instructions to the letter but I cannot go further. Please help.

    Reply
  77. i unable browse the nagios page

    Forbidden

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

    Reply
  78. Hi Ravi,

    Thank for share the articlel of nagios installation. I have installed the nagios 4.0.1 and configure the sendmail for receive the email alart. i am not using any firewall. I am getting the following error message:-

    notify-host-by-email;(No output on stdout) stderr:

    Thanks
    Jitender

    Reply
  79. Dear Ravi,

    I follow the same step by step after that nagios is open with the browser but when I try to access other features like..host, services showing the that error is below.

    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.
    Apache/2.2.15 (CentOS) Server at 192.168.1.100 Port 80

    Reply
  80. HI Ravi,

    Excellent procedure. I installed on CentOS6.5, no issue found except firewall.

    your procedure is for Nagios 4.0.1 with Nagios Plugin 1.5. current version is nagios 4.0.8.
    Can I use the same procedure to install nagios 4.0.8 ?
    how about the Nagios Plugin?

    Kind regards.
    Sara

    Reply
    • Yes Sara, you can use same instructions for latest version too, only diffrent is, make sure you replace versions accordingly, while following. :)

      Reply
  81. Coaching people to install from source? In 2014, that’s what we call a ‘day two’ problem, and it can be seen as irresponsible.

    Even those who’ve been using EL for a while prefer a packaged install because builds are repeatable, reliable and verifiable. This makes updates trivial and, most of all, something you can automate.

    A config;make;make-install is something that ends up on the “I’ll do it tomorrow/saturday” list, where an RPM update is done via cron while you sleep, and the army of RH testors all but guarantees it’ll go smoothly.

    The difference in reliability alone is like comparing a concept car against a daily driver.

    Reply
    • Yes, there are lots of advantage installing from source, like you will configure required or selected moduels for Nagios, from source you can install latest version of Nagios, etc..

      Reply
  82. Excellent article thank you, I am a CentOS beginner and I am having a problem after following your well written instructions… I was wondering if you can help please?

    [root@nagios-cs libexec]# ./check_ping -H 8.8.8.8 -w 200,20% -c 600,60% -p4
    ping
    CRITICAL – Could not interpret output from ping command

    However, I can ping using:

    [root@nagios-cs libexec]# ping -n -U -w 10 -c 5 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
    64 bytes from 8.8.8.8: icmp_seq=1 ttl=50 time=11.6 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=50 time=11.5 ms

    The permissions look ok as far as I can tell:

    -rwsr-x— 1 root nagios 174K Aug 21 15:40 check_ping

    And SELinux is disabled.

    Any ideas would be most welcome.

    Kind regards

    Adam

    I am stuck

    Reply
    • Nagios user don’t have permission to execute ping command, to fix this issue use the following command and then try again.

      # chmod u+s /bin/ping 
      
      Reply
  83. Hi Dear , I have install Nagios, Nagios-pluging and nrpe with all lib, note also 127.0.0.1 is figured in nrpe conf,
    but i still receive error below:

    CHECK_NRPE: Error – Could not complete SSL handshake.

    would you advice pls?

    Reply
  84. I am getting the below error while downloading core nagios

    unable to resolve host address prdownloads.sourceforge.net

    Reply
  85. When i restart the nagious service i am getting this Error, will you plz sort it out….

    Job for nagios.service failed. See ‘systemctl status nagios.service’ and ‘journalctl -xn’ for details.

    Reply
  86. Hi,
    Thanks Ravi. Already de-bugged the issue as mentioned below.
    #vi /usr/local/nagios/etc/cgi.cfg
    # READ-ONLY USERS
    # A comma-delimited list of usernames that have read-only rights in
    # the CGIs. This will block any service or host commands normally shown
    # on the extinfo CGI pages. It will also block comments from being shown
    # to read-only users.
    authorized_for_read_only=node1,node2,node3
    By adding the above comments in the file, the issue got resolved.
    REPLY

    Reply
  87. Hi,

    Encountered the below message when trying to plan for system downtime through nagios portal

    “Sorry, but you are not authorized to commit the specified command”

    Any pre-configuration is required to do this.

    Reply
    • Is your nagios configuration files are writeable by Apache user? and also check all the files have correct web server owner and group.

      Reply
  88. Hi Sir,

    I Connect two host with my server & its showing all three is up but host does’nt show in services list, its show only server host & when i down to any client effect does’nt show on the gui pannel

    Reply
  89. nagaios has been installed and send mail also installed, i have checked in mail logs logs are there but its not coming out form the pc.

    i had mail my srv details pls check and support me sir

    Reply
  90. Thank you for sharing such an excellent and appropriate step by step doc.

    I really appreciate for the time you spent and your knowledge and understanding of the complete subject.

    Reply
    • Thanks Chandi, for such kind of words which encourage us to write more such in-depth articles for our fellow readers like you. And don’t forget to share our updates.

      Reply
  91. I installed Nagios following the procedure, seem fine as I’m able to lunch the server web address.

    the issue is when I click on host or any other part withing the web MOnitoring I get the following error.

    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.
    Apache/2.2.15 (CentOS) Server at localhost Port 80

    this is what I get on he log:

    [Mon Jun 30 07:12:57 2014] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
    [Mon Jun 30 07:12:57 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Mon Jun 30 07:12:57 2014] [notice] Digest: generating secret for digest authentication …
    [Mon Jun 30 07:12:57 2014] [notice] Digest: done
    [Mon Jun 30 07:12:57 2014] [warn] ./mod_dnssd.c: No services found to register
    [Mon Jun 30 07:12:57 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured — resuming normal operations
    [Mon Jun 30 07:14:49 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
    [Mon Jun 30 07:19:49 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
    [Mon Jun 30 07:24:49 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
    [Mon Jun 30 07:29:49 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
    [Mon Jun 30 07:34:49 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
    [root@localhost html]# cd /var/www

    Reply
  92. sir

    i am trying install nagios but i am getting bellow error

    “[root@master nagios-plugins-2.0.3]# service nagios start

    Executable file /usr/local/nagios/bin/nagios not found. Exiting.

    [root@master nagios-plugins-2.0.3]#

    what is the problem sir?

    Reply
    • Your installation is unsuccessful, might you have missed to run ‘make install’ command. Follow instructions correctly, don’t miss any single command.

      Reply
  93. hi I ahve installed nagios4.0.1 on centos6.3, i can browse the site but whenever i am trying open any other link its not openning… trying to save status.cgi file
    whats the issue?

    Reply
    • It seems CGI was not properly installed or configured. Please check your httpd configuration and include correct nagios configuration.

      Reply
  94. Hi,

    I am faced with an issue as I cannot installed the nagios-plugin. I am using a RHEL3 which I am installing the latest nagios and its plugins. However when installing the plugins its giving me the error as follows

    check_pgsql.c:245: (Each undeclared identifier is reported only once
    check_pgsql.c:245: for each function it appears in.)
    make[2]: *** [check_pgsql.o] Error 1
    make[2]: Leaving directory `/root/nagios-plugins-2.0.2/plugins’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/nagios-plugins-2.0.2′
    make: *** [all] Error 2

    Any help on this would be appreciated.

    Thank you
    Phing,

    Reply
    • You’re trying to install the latest Nagios version on too old RHEL distro, I think it will won’t work out for you, you must upgrade your system to latest version to install latest Nagios version.

      Reply
  95. i have installed nagios 4.0.1 in centos and it works fine…but when i try to create availability report it shows me following error…

    the gateway did not receive a timely response from the upstream server or application

    Please Help

    Regards

    Jyotiranjan

    Reply
  96. Hi, wonderful information in these posts. I have read through them and have not found anything about an issue I am seeing.

    I am installing V. 4.0.4 on CentOS 6.5 64 bit. I have a basic installation and many host item configured. They are successfully being tested with PINGs, but none of the services are working. I get a “Gateway Time-out” error when I attempt to enable services check on a host.

    Also when I go to the “Configuration” option in the left side menu on the Nagios home page and select the “Host” option from the pull down menu I get this error,

    “It appears as though you do not have permission to view the configuration information you requested…

    If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file.”

    I have not seen anything on an error like this. Do you have any suggestions on a fix?

    Thanks

    Jeff

    Reply
  97. 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.
    Apache/2.2.15 (CentOS) Server at localhost Port 80

    i dont know what’s this ?
    help me plzz

    Reply
    • It means your Nagios installation was unsuccessful, please follow the instructions carefully and try again.

      Reply
  98. Hello Sir

    installation and configuration done. but mails are not going to recipient.

    Pls help on this issue .

    Thank you
    chandoo

    Reply
    • Please check the mail logs and find out the reason why its not being delivered to recipient. And also make sure you have correct MX, SPF records are added on your mail domain.

      Reply
  99. install php package and dependencies before so that you can avoid all the errors.

    if you are getting conflicting errors while installing php with yum disable multiple repositories and try.

    Reply
  100. Another example:

    sudo tail -50 /var/log/messages
    [sudo] password for nagios:
    nagios is not in the sudoers file. This incident will be reported.

    Reply
  101. Hi,

    I have few questions related to the post.

    1. Why you choose “/root ” to do the installation?
    2. Do I have to give any special permissions to nagios user because it cant do soem tasks for example if I want to restart nagios service I get below error:
    ****sudo service nagios restart
    [sudo] password for nagios:
    —- nagios is not in the sudoers file. This incident will be reported.***
    3. So do I have to provide user nagios some special permissions?

    I am asking this because somehow I think my nagios stopped working because I installed it in root/or I am not able to use use nagios..

    problem with Nagios – the web interface has stopped responding. It is not updating – no communication with nagios.

    Thanks
    Kim

    Reply
      • It is CentOS but now I have reinstalled it again using Nagios official installation guide,I am not sure if the problem was installaing it in root or something else but I just thought to ask you.

        Also, I am trying to setup notification in nagios so that I could get an email but I dont. DO I have to enable something special on CentOS as well. Like postfix? I have changed the name in Contacts.cfg and everything else seems to be fine.

        Any idea?

        Reply
        • Yes, you correct you need to install special mail services like postfix or sendmail to send out mails from the box.

          Reply
  102. Excuse the English, I’m using a translator. I installed everything right in my cpanel server, but it does not have access by ip / nagios. Know how to help?

    Reply
  103. Hi Sir Ravi

    In addition when I try to restart the httpd I got this start when httpd starting

    [root@TestLinux nagios-plugins-1.5]# service httpd restart
    Stopping httpd: [ OK ]
    Starting httpd: httpd: apr_sockaddr_info_get() failed for TestLinux
    httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

    Thank you!
    James

    Reply
    • Although this warning message doesn’t interfere with your Apache starting, you can simply ignore it, or you can add your server hostname to /etc/hosts file to get rid of this error messsage.

      Reply
  104. Hi Sir I follow all the steps it seems I get all it correct but when I access the GUI I got the home page correct but when I go to services, host, tactical overview etc… I got this on my page please advise thank you!

    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.
    Apache/2.2.15 (CentOS) Server at 10.10.1.202 Port 80

    Reply
  105. Hello ,
    Followed the tutorial but i can’t seem to make the notification work with postfix or sendmail . I have Centos 6.5 on my machine and just installed Nagios 4.0.5.

    Output from /var/log/messages

    ” wproc: stderr line 01: /bin/sh: -c: line 0: unexpected EOF while looking for matching “’
    wproc: stderr line 02: /bin/sh: -c: line 1: syntax error: unexpected end of file
    Output from contacts cfg:

    define command{
    command_name notify-host-by-email
    command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
    }

    # ‘notify-host-by-email’ command definition
    define command{
    command_name notify-host-by-email
    command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
    }
    Any ideea where to look?

    Reply
  106. while i try to add comment it gives error message

    Error: Could not stat() command file ‘/usr/local/nagios/var/rw/nagios.cmd’!

    Reply
    • Please set the correct permissions by running following commands.

      # chown nagios.nagcmd /usr/local/nagios/var/rw 
      # chmod g+rwx /usr/local/nagios/var/rw 
      # chmod g+s /usr/local/nagios/var/rw
      

      This should work properly without errors.

      Reply
      • Hello sir,

        I follow the steps but it gives same error.I think i have miss to create some file.i still cannot add comment.

        Reply
  107. which is suitable for mail generation postfix or sendmail in nagios

    nagios is default installtion postfix but why to install sendmail

    Reply
  108. Hey,

    got solution already. Command “sudo setenforce 0” resolved the problem.
    Thanks again for awesome article.

    Best Wishes
    Kim

    Reply
  109. Hello Sir,

    Great Article, everything worked perfectly. BUT when I click on host or on any other link I get error below error. Any idea?
    “””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.”””

    Thanks
    Kim

    Reply
  110. hi
    i try to install i unable to install nagios. i downloaded two packages as above mentioned when i enter the below command i am getting this error plz reply me
    command : ./configure –with-command-group=nagcmd
    checking for a BSD-compatible install… /usr/bin/install -c
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking for gcc… no
    checking for cc… no
    checking for cl.exe… no
    configure: error: in `/root/nagios/nagios-4.0.1′:
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details

    Reply
      • hi
        finally i got it …the problem was not installed gcc and gcc-lib and dependency packages due to yum repository problem ,i fixed the that problem ,and i installed dependency packages .after it worked fine ….by the way thank you very mush replying ….thank u again

        Reply
  111. Hello Ravi,

    I have install nagios core 3.0 in my centos machine, ever thing installed properly with our error but once i am login nagios from web interface and accessing link host on left hand side getting error message Internal Server Problem.

    Please advice me the solution?

    Reply
  112. Hello ravi..

    I did all steps to install nagios and nagios plugin, but i installed the last versions, 4.0.4 and plugins 2.0.

    So when i tried to start the nagios on browser, cannot find the page.

    Reply
    • Is there any error you getting while accessing the page? If yes! please look at the comment section for solutions. I hope you will fix it.

      Reply
  113. hI Brother, thanks for your tutorial is very easy and clear. So i followed every single step in your example, and every was ok. I’m facing this error:

    http://myipaddres/nagios

    Not Found

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

    i’m running on Centos 6.5

    Please can you help me?

    Tanks for your time.

    Reply
  114. Hello, again please do not consider my previous reply, because i solved it.
    but now facing another with step number 10.
    I am unable to see webinterface using the ip address/nagios..
    please help me

    Reply
      • Hi Ravi,
        thanks for the support , but fortunetly i solved the problem by turning off the firewall, initially i tried to solve the problem by opening the http port 80 but was unable to due to some reason so i turned it off.
        but the NEW PROBLEM I am facing is when entering the webinterface -> credentials->Homepage->Clicking Host Group (from left Menu) gives me “It appears as though you do not have permission to view information for any of the hosts you requested…”..i have no idea where it went wrong..

        Reply
          • Dear Sir,

            I am also facing same issue.. But Some time I am able to get output and some time nagios show error ” It appears as though you do not have permission to view information for any of the services you requested…”

            My SELinux is also disabled.

  115. Hello ,
    i am stuck in doing 2nd wget (which is for plugins) it gives me error “unable to resolve host address”
    any idea?
    i am proxy server to go on internet but i already set it and its working .
    I using centos 6.5

    Reply
  116. Hi, i had also installed the nagios plugins from the tarball and installation goes fine without any error.

    But i cannot find the location as where those plugins installed.

    i had checked /usr/local/nagios but cannot found it.

    Please help

    Reply
  117. hai

    iam installing nagios on centos 6.4 i did not get any email alerts

    i am adding my mail address in commands and contacts.cfg file but i did not get any mails

    if there ant answer pls tell me

    Reply
  118. hello sir ,

    yea i got it that …and mail notifications are not coming ,, today i shut down the server due to maintenance.i was expecting the e-mail ..but there is no use ..

    i have configured the e mail id my personal ..please have a look

    ###############################################################################
    ###############################################################################
    #
    # 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 ****

    Reply
          • yes i have installed the sendmail, but there no luck ??

            i given test mail output is the same ..no erros but mails are not coming to inbox.

            mutt -s “Test Email” [email protected] < /dev/null
            @@@@@@@@@@@@@@@@@@@@@@@@@@@@
            and i have checked in nagios please find the below info

            Host Service Type Time Contact Notification Command Information
            localhost HTTP WARNING 03-24-2014 10:36:36 nagiosadmin notify-service-by-email HTTP WARNING: HTTP/1.1 403 Forbidden – 4807 bytes in 0.006 second response time
            localhost HTTP WARNING 03-24-2014 09:36:36 nagiosadmin notify-service-by-email HTTP WARNING: HTTP/1.1 403 Forbidden – 4807 bytes in 0.002 second response time
            localhost HTTP WARNING 03-24-2014 08:36:36 nagiosadmin notify-service-by-email HTTP WARNING: HTTP/1.1 403 Forbidden – 4807 bytes in 0.002 second response time

  119. Hello sir

    Greetings !!

    i have installed the nagios successfully as per you given steps ,, once i login to server ..its throwing the error message given by below.

    Please help me about this

    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.

    Apache/2.2.17 (Fedora) Server at 192.168.50.4 Port 80

    Reply
    • The error basically about SELinux context file execution issue, which can be fixed by setting the permission on nagios installtion core directories, like shown below.

      # chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
      # chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
      
      Reply
  120. Hi i have installed the nagios as you given steps ..but finally when loged in its giving the Forbidden error ! please find the below .

    Forbidden

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

    Apache/2.2.17 (Fedora) Server at 192.168.50.4 Port 80

    Reply
  121. I found the missing bit for the external commands.
    It was a sneaky thing of SELINUX.

    You need to add this 3rd SELINUX exceptions as well:

    chcon -R -t httpd_sys_script_rw_t /usr/local/nagios/var/rw

    Reply
  122. This is ackward. I can’t seem to get rid of :
    Error: Could not stat() command file ‘/usr/local/nagios/var/rw/nagios.cmd’!
    The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.
    An error occurred while attempting to commit your command for processing.

    I doublechecked permission, and all of that. Worked my way to a dozen or so of troubleshooting pages referring to this issue but I can’t seem to find the cause and fix it.

    # ls -l rw
    prw-rw—-. 1 nagios nagcmd 0 Mar 5 17:11 nagios.cmd
    srw-rw—-. 1 nagios nagcmd 0 Mar 7 11:30 nagios.qh
    # ls -ld rw
    drwxrwsr-x. 2 nagios nagcmd 4096 Mar 7 11:30 rw
    # grep nagios /etc/group
    nagios:x:501:nagios,apache
    nagcmd:x:502:nagios,apache

    – httpd runs as user apache

    So at the moment I can’t think of anything more to check.

    Reply
  123. I am new to Linux. When I run “root@ubuntuServer:/root/nagios/nagios-4.0.1# make install-webconfig” I get this:

    /usr/bin/install -c -m 644 sample-config/httpd.conf .d/nagios.conf
    /usr/bin/install: cannot create regular file ‘/etc/httpd/conf .d/nagios.conf’ : No such file or directory
    make: *** [install-webconf] Error 1

    Reply
  124. Hi,

    Can anyone tell me the procedure to install mysql plugin in nagios-plugin-1.5 so that i can monitor mysql services.

    Thanks in advance..!!!!

    Reply
  125. I got this error, Please give a solution

    Not Found

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

    Reply
  126. Hie Ravi

    I configured my nagios long time ago and now i do not remember where i configured notifications to come from my gmail account, i have tried in contacts.cfg but i only see the destination mail box please help

    Reply
  127. i was install nagios in linux el6 64 bit. nagios is working fine. after opening in browser when i click on left panel it ask me to save status.cgi file always. for eg: when i click hosts or maps or services anything in left panel its not opening other than that it ask to save status.cgi file. Thanks in Advance :)

    Reply
  128. Hi, except Nagios, I search that Pandora FMS is also a good monitor tool but I’m not know well how to configuration it. Could you write a topic for Pandora :D Thanks.

    Reply
  129. Hi all,

    I have completed installing nagios 4.0.1 but i faced a problem “(No output on stdout) stderr: ” in status information. How to fix the issue, thank.

    Reply
  130. Thanks a lot for that tutorial, all have worked fine at once, clear explanation and examples.
    Awesome job!

    Best wishes to you and thanks again!

    Reply
  131. thanks
    Ravi
    now its working and this is really helpful link for linux and the most important thing is you replay to the peoples questions that is really best thing about you

    again thanks alot

    Reply
  132. hallo ravi,
    can you please help me out . i am having really a little problem,
    your explanations is so great and the way how you explain the thing is owesome,
    may be i have missed something while configuration.
    when i want to get nagios in web browwser then it shows that web is not availble.
    can you please help me out for this problem
    thanks

    Reply
      • “Error: Connection interrupted

        The connection to the server was reset while the page was loading.

        The site could be temporarily unavailable, please try again later.
        If you can not access any other website, please check your computer’s network connection.
        If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Internet.”

        hallo ravi ,
        i am getting this error.
        when i was doing the configuration. i never get any error but i can’t access it via web browwser.

        Reply
      • apacche is running in the linux machine and status of httpd is ok .

        but when we try to access via IP of server then it doesn’T load and say web page is not availbale.

        Reply
          • Pretty disappointing. This guide seems to be pretty comprehensive, but it is lacking some fundamental things.

            I went through it EXACTLY and had no error messages, no problems, nothing. Both nagios and httpd started up perfectly.
            (Okay, I installed nagios-4.0.6 and plugins-2.0.2, otherwise the same)

            No connection to httpd on tcp/80, unable to connect.
            I opened the port, and then disabled iptables. No changes, still cannot access.

            I’ve been through all the comments, looked into problems with SELinux, permissions in /var/www/html and other possible causes. Nothing helped.

            I have gotten nothing but disappointment from TECMINT overall. This is the third or fourth howto I’ve looked at here, the first one I actually tried, and I have found varying flaws in all of them that are pretty obvious. You consistently fail to mention basic, fundamental things that a new user should at least be aware of. You don’t warn when some things might be a big problem.

            I appreciate this may be a volunteer effort for may of you, but bad information is still bad information. I won’t be coming back.

  133. hallo ravi ,

    after configure all the step , when i try to get it in web server then it doesn’t work ,
    it say that web page is not availbale.

    Reply
  134. Hi ,

    Nice Guide for the new users who wants to learn Nagios.

    But i want to know why there is a need of “nagcmd group” cant we use the default “nagios” group which will be automatically created while creating the “nagios” user.

    Regards
    Abyakta

    Reply
  135. Hi Mr. Ravi Saive,

    I installed nagios version 4.0 on fedora 19
    when i check the status:
    systemctl status nagios.service

    i get the error:

    Loaded: loaded (/etc/rc.d/init.d/nagios)
    Active: failed (Result:timeout) since Mon 2013-11-18 19:04:22 Est; 44s ago
    Process: 2104 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/nagios.service

    Then i get:
    [1]: Starting LSB: start and stop Nagios monitoring server…
    Failed to start LSB: start and stop Nagios monitoring server.
    Unit nagios.service entered failed state

    although i am able to use the service i can login to nagios and see my local host and my other lamp servers and i can see the services ssh, ping, etc… but i can’t get any email notifications ( is that the reason why by the way)
    can you please help me fix this error thank

    i tried reinstalling nagios, restarting nagios, restarting httpd,

    tried the steps from this page:
    http://nagios.sourceforge.net/docs/3_0/startstop.html

    please help thanks,

    Reply
  136. I am new to this, But I did as here mentioned……. I am able to log in but it showing – But when i click on any option mentioned there it shows internal server error

    Reply
  137. Hello Sir,

    I want to monitoring Cisco sg300 switch by nagios, check switch load, traffic, and load. i have try to configure snmp but i was not success. so please help me for this..

    Thanks
    Rahul Patadiya

    Reply
    • Most likely the error occurs due to missing SNMP packages. Make sure you have the following packages installed on your system, if not install them.

      # yum net-snmp-libs net-snmp net-snmp-utils
      

      Lastly, you need to re-compile the Nagios Plugins. Go to the nagios plugin directory and run the following commands.

      [root@tecmint nagios]# cd /root/nagios
      [root@tecmint nagios]# cd nagios-plugins-1.5
      [root@tecmint nagios]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
      [root@tecmint nagios]# make
      [root@tecmint nagios]# make install
      

      After installing, make sure to restart nagios.

      # service nagios start
      

      rpm -qa | grep net-snmp

      Reply
      • ThnX, It started working after installing above packages.

        But nagios will not start in enforcing mode, to start it run this commands:

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

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

        Now my nagios os is working smoothly and i am waiting for next article of this series :)

        Reply
  138. Now how to add the client machine to monitor from the nagios server. Please give complete article on how to install and configure nagios server and client for monitoring and the mail alerts as well

    Reply
    • The second part of this article on how to add Linux Hosts to Nagios server in progress, will soon publish it. Stay tuned for that. Thanks

      Reply
      • Hi Ravi,

        Would like to know about the communication between nagios server and nagios clients, how it works step by step.

        Reg,
        Mastan

        Reply
      • Hi Ravi,

        I have configured Nagios server and I could monitor remote machines as well using the information given below. I would like to setup email notification. Could you please help me out in this. One of my friend has configured email setup using sendEmail and it’s working fine. I was unable to setup. Can you please help me out in this.

        Regards,
        Rashmi

        Reply
      • I have installed Nagios Core 4.0.1 and works fine… thanks for your help..

        But when i want to create availability report it shows me the following error..

        the gateway did not receive a timely response from the upstream server or application

        please help

        Reply
      • Thank you for this great article! I managed to install it well . I work simultaneously on high availability, except that I do not know the command to allow nagios to spend at the cluster level. I am running cluster, but I can not bring out Nagios

        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.