Introduction to Linux - A Hands on Guide | Linux Bible | Linux From Scratch | A Newbie's Getting Started Guide to Linux | Linux Command Line Cheat Sheet | More Linux eBooks



Tuesday, 20 May 2014

"Error: Could not read host and service status information" in Nagios

    In the previous article, we have learned - How To : Install Nagios Core 4 on Ubuntu Linux. After installing Nagios Core 4 on your Ubuntu system, when you try to search for the hosts that are being monitored, by clicking on the "Hosts" link on the left panel, or when you try to monitor the services running on the added hosts by clicking on "Services" link, you might face an error page that displays:

Error: Could not read host and service status information!

Solution:
First of all, make sure that the nagios service is running. You can check this by running the following command:

service nagios status

OR

/etc/init.d/nagios status
The output should resemble:

nagios start/running, process 1234
If the service is not running, you will see an output as follows:

nagios stop/waiting
To start the nagios service, run the following command:

service nagios start
Now, start the nagios daemon using the command:

/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Now, try clicking on "Hosts" or "Services" link. Error should have been eliminated, at least until the next reboot.

8 comments:

  1. thanks.. it worked

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. error which i got is like : No lock file found in /usr/local/nagios/var/nagios.lock

    ReplyDelete
    Replies
    1. Its because 'nagios' service is not running. You can start it with 'service nagios start'

      Delete
  4. Hi I followed the steps above and it still didnt work for me. Any idea why this could be happening?

    ReplyDelete
  5. while running the command service nagios status

    Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Mon 2016-05-30 16:12:30 NPT; 15min ago
    Docs: https://www.nagios.org/documentation/
    Process: 17833 ExecStartPre=/usr/sbin/nagios -v /etc/nagios/nagios.cfg (code=exited, status=1/FAILURE)

    May 30 16:12:30 centos7 nagios[17833]: Check your configuration file(s...d
    May 30 16:12:30 centos7 nagios[17833]: directives and data defintions....s
    May 30 16:12:30 centos7 nagios[17833]: version of Nagios, you should b...s
    May 30 16:12:30 centos7 nagios[17833]: may have been removed or modifi...d
    May 30 16:12:30 centos7 nagios[17833]: the HTML documentation regardin...e
    May 30 16:12:30 centos7 nagios[17833]: 'Whats New' section to find out....
    May 30 16:12:30 centos7 systemd[1]: nagios.service: control process ex...1
    May 30 16:12:30 centos7 systemd[1]: Failed to start Nagios Network Mon....
    May 30 16:12:30 centos7 systemd[1]: Unit nagios.service entered failed....
    May 30 16:12:30 centos7 systemd[1]: nagios.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.

    show error can't start nagios.

    ReplyDelete
  6. for me chmod 777 -R /usr/local/nagios/var/spool/checkresults/

    Hope this helps
    Regards,
    Premkumar Waghmare

    ReplyDelete