Nagios error could not read host and service status information

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.
  • Board index Community Support Forums For Nagios Open Source Projects Open Source Nagios Projects

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

Error: Could not read host and service status information!

Hi,

I have a below error in nagios and I wonder if someone could help.

Code: Select all
Whoops!
Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you've just installed things, make sure you read the documentation on starting Nagios.

Some other things you should check in order to resolve this error include:

Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios!
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.

I ran

Code: Select all
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

which gave me one error, and then I stupidly (too quickly and not checking it) ran

Code: Select all
sudo /etc/rc.d/init.d/nagios reload

The error was:

Code: Select all
Error: The description string for service 'Free Memory, less than 1.5 eq Critical' on host 'pfsense' contains one or more illegal characters.

Basically a dot or a comma which I now removed.

Code: Select all
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

doesn’t give me any errors now, but nagios still can’t read host and service status information.

Nagios is running

Code: Select all
ps -ef | grep nagios
nagios   15391     1  0 15:33 ?        00:00:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
root     15540 15526  0 15:40 pts/0    00:00:00 grep --color=auto nagios

I can access the main page, and MRTG graphs, but any other page is giving me

Code: Select all
Whoops!

error.

Debug is set to zero but I can change it and maybe get some info?

tr53
 
Posts: 6
Joined: Thu Oct 24, 2019 10:01 am

Re: Error: Could not read host and service status informatio

Postby scottwilkerson » Thu Oct 24, 2019 2:29 pm

Did you restart nagios after making the correction?

Did you check the nagios.log for startup errors?

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

scottwilkerson
DevOps Engineer
 
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Error: Could not read host and service status informatio

Postby tr53 » Fri Oct 25, 2019 3:33 am

Hi Scott,

Yes I did restart nagios using

Code: Select all
sudo /etc/rc.d/init.d/nagios reload

and also by restarting the server.

Code: Select all
cat /var/log/nagios/nagios.log
[1571987038] Caught SIGTERM, shutting down...
[1571987038] Successfully shutdown... (PID=15391)
[1571987089] Nagios 3.5.1 starting... (PID=2749)
[1571987089] Local time is Fri Oct 25 07:04:49 UTC 2019
[1571987089] LOG VERSION: 2.0
[1571987089] Finished daemonizing... (New PID=2782)
[1571987479] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1571990689] Auto-save of retention data completed successfully.
[1571990769] SERVICE NOTIFICATION: nagiosadmin;localhost;HTTP;WARNING;notify-service-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden - 5173 bytes in 0.001 second response time
[1571991079] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
tr53
 
Posts: 6
Joined: Thu Oct 24, 2019 10:01 am

Re: Error: Could not read host and service status informatio

Postby scottwilkerson » Fri Oct 25, 2019 8:07 am

Can you show the output of the following

Code: Select all
grep nag /etc/group
getenforce
ls -al /usr/local/nagios/var

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

scottwilkerson
DevOps Engineer
 
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Error: Could not read host and service status informatio

Postby tr53 » Fri Oct 25, 2019 8:13 am

Hi,

Code: Select all
$ grep nag /etc/group
nagios:x:497:apache

$ getenforce
Disabled

$ ls -al /usr/local/nagios/var
total 848
drwxrwxr-x 5 nagios nagios   4096 Oct 24 14:48 .
drwxr-xr-x 9 root   root     4096 Jul 21  2016 ..
drwxrwxr-x 2 nagios nagios  61440 Oct 23 23:59 archives
-rw-r--r-- 1 nagios nagios     34 Aug 21  2017 nagios.configtest
-rw-r--r-- 1 nagios nagios 122382 Oct 24  2016 nagios.debug
-rw-r--r-- 1 nagios nagios      6 Feb 25  2019 nagios.lock
-rw-r--r-- 1 nagios nagios  65710 Oct 24 14:48 nagios.log
-rw-rw-r-- 1 nagios nagios 143365 Dec 19  2016 nagios.tmpo0D4xY
-rw-r--r-- 1 nagios nagios 129701 Oct 24 14:47 objects.cache
-rw-r--r-- 1 nagios nagios 100248 Aug 21  2017 objects.precache
-rw------- 1 nagios nagios 194538 Oct 24 14:48 retention.dat
drwxrwsr-x 2 nagios nagios   4096 Oct 24 14:48 rw
drwxr-xr-x 3 root   root     4096 Jul 21  2016 spool

tr53
 
Posts: 6
Joined: Thu Oct 24, 2019 10:01 am

Re: Error: Could not read host and service status informatio

Postby scottwilkerson » Fri Oct 25, 2019 8:29 am

Somehow the nagios user isn’t part of the nagios group

As root run the following:

Code: Select all
usermod -a -G nagios nagios

also a few permissions don’t seem correct

Code: Select all
chown nagios:nagios /usr/local/nagios /usr/local/nagios/var/spool

then restart nagios and remove that really old lock file if it still exists

Code: Select all
service nagios stop
rm -f /usr/local/nagios/var/nagios.lock
service nagios start

Also, I don’t see a status.dat file, could be caused by permissions but if the above doesn’t work show the output of the following

Code: Select all
grep status_file /usr/local/nagios/etc/nagios.cfg

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

scottwilkerson
DevOps Engineer
 
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Error: Could not read host and service status informatio

Postby tr53 » Fri Oct 25, 2019 9:15 am

Hi,

Thank you for this. I applied commands you mentioned but the issue still persist.

Code: Select all
$ sudo usermod -a -G nagios nagios
$ sudo chown nagios:nagios /usr/local/nagios /usr/local/nagios/var/spool
$ sudo service nagios stop
Stopping nagios: done.

$ sudo rm -f /usr/local/nagios/var/nagios.lock

$ sudo service nagios start
Starting nagios: done.

$ ls -al /usr/local/nagios/var
total 844
drwxrwxr-x 5 nagios nagios   4096 Oct 25 14:04 .
drwxr-xr-x 9 nagios nagios   4096 Jul 21  2016 ..
drwxrwxr-x 2 nagios nagios  61440 Oct 23 23:59 archives
-rw-r--r-- 1 nagios nagios     34 Aug 21  2017 nagios.configtest
-rw-r--r-- 1 nagios nagios 122382 Oct 24  2016 nagios.debug
-rw-r--r-- 1 nagios nagios  65710 Oct 24 14:48 nagios.log
-rw-rw-r-- 1 nagios nagios 143365 Dec 19  2016 nagios.tmpo0D4xY
-rw-r--r-- 1 nagios nagios 129701 Oct 24 14:47 objects.cache
-rw-r--r-- 1 nagios nagios 100248 Aug 21  2017 objects.precache
-rw------- 1 nagios nagios 194538 Oct 24 14:48 retention.dat
drwxrwsr-x 2 nagios nagios   4096 Oct 24 14:48 rw
drwxr-xr-x 3 nagios nagios   4096 Jul 21  2016 spool

$ grep nag /etc/group
nagios:x:497:apache,nagios

nagios.cfg point to status.dat

Code: Select all
$ grep status_file /usr/local/nagios/etc/nagios.cfg
status_file=/usr/local/nagios/var/status.dat

but I found it here

Code: Select all
# find . -name status.dat
./var/log/nagios/status.dat
tr53
 
Posts: 6
Joined: Thu Oct 24, 2019 10:01 am

Re: Error: Could not read host and service status informatio

Postby scottwilkerson » Fri Oct 25, 2019 9:49 am

tr53 wrote:but I found it here

Code: Select all
# find . -name status.dat
./var/log/nagios/status.dat

That is bizarre

Can you show the output of

Code: Select all
ps -ef|grep nagios.cfg

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

scottwilkerson
DevOps Engineer
 
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Error: Could not read host and service status informatio

Postby tr53 » Fri Oct 25, 2019 10:15 am

Code: Select all
$ ps -ef|grep nagios.cfg
nagios    8796     1  0 14:04 ?        00:00:01 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
ec2-user  9894  7894  0 15:14 pts/0    00:00:00 grep --color=auto nagios.cfg
tr53
 
Posts: 6
Joined: Thu Oct 24, 2019 10:01 am

Re: Error: Could not read host and service status informatio

Postby scottwilkerson » Fri Oct 25, 2019 10:22 am

tr53 wrote:

Code: Select all
$ ps -ef|grep nagios.cfg
nagios    8796     1  0 14:04 ?        00:00:01 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
ec2-user  9894  7894  0 15:14 pts/0    00:00:00 grep --color=auto nagios.cfg

Ok, there is a problem here, you somehow have installed both a source install and a packaged (maybe yum/apt) install

So you have one config going off of

Code: Select all
/etc/nagios/nagios.cfg

and another going off of

Code: Select all
/usr/local/nagios/etc/nagios.cfg

You need to determine which set of configs are correct… and I would highly recommend moving them to a new clean install if at all possible as this is going to be really confusing for anyone administering this machine (not to mention the cleanup is going to already get messy)
https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

scottwilkerson
DevOps Engineer
 
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Open Source Nagios Projects

Who is online

Users browsing this forum: No registered users and 18 guests

Nagios was upgraded from 3.5.1 to 4.0.8

I wanted to ask this in the nagios support forum, but an hour later, I do not receive a confirmation email for setting up my account…

nagios seems to run OK as a service, but the web CGIs are not working, and there are no errors in error.log for apache, nor nagios.log. I’ve checked permission, and looked at some of the C code having this embedded error:

Whoops!
Error: Could not read host and service status information!

The same error above appears for almost every menu on the left side of the main page for nagios.

nagios.log looks like this on start and then stopping, from the init:

[1431102009] Nagios 4.0.8 starting... (PID=27779)
[1431102009] Local time is Fri May 08 13:20:09 ADT 2015
[1431102009] LOG VERSION: 2.0
[1431102009] qh: Socket '/usr/local/nagios/var/rw/query.sh' successfully initialized
[1431102009] qh: core query handler registered
[1431102009] nerd: Channel hostchecks registered successfully
[1431102009] nerd: Channel servicechecks registered successfully
[1431102009] nerd: Channel opathchecks registered successfully
[1431102009] nerd: Fully initialized and ready to rock!
[1431102009] wproc: Successfully registered manager as @wproc with query handler
[1431102009] wproc: Registry request: name=Core Worker 27785;pid=27785
[1431102009] wproc: Registry request: name=Core Worker 27786;pid=27786
[1431102009] wproc: Registry request: name=Core Worker 27782;pid=27782
[1431102009] wproc: Registry request: name=Core Worker 27781;pid=27781
[1431102009] wproc: Registry request: name=Core Worker 27783;pid=27783
[1431102009] wproc: Registry request: name=Core Worker 27784;pid=27784
[1431102009] Successfully launched command file worker with pid 27787
[1431102022] Caught SIGTERM, shutting down...
[1431102022] Successfully shutdown... (PID=27779)
[1431102022] Event broker module 'NERD' deinitialized successfully.

Running with -v is clean:

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

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
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 816 services.
        Checked 826 hosts.
        Checked 11 host groups.
        Checked 0 service groups.
        Checked 18 contacts.
        Checked 13 contact groups.
        Checked 61 commands.
        Checked 6 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 826 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 6 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

Also, the check_nagios says we’re running OK:

# /usr/local/nagios/libexec/check_nagios /var/log/nagios.log 5 '/usr/local/nagios/bin/nagios'
NAGIOS OK: 8 processes, status log updated 11 seconds ago

One possibility is the error means it can’t access the nagios.cfg file. I’ve checked that the path to that is r-x for ‘other’ (to cover apache user) on all directories on the path. In any case, if there was a permission issue, that should make an apache error. I’ve been working on this for a couple of hours and can’t find the point of failure, or what changed.

The main page also shows «Unable to get process status» under the Nagios Core logo. That is from running statusjson.cgi in main.php — not sure what it is looking at, but the page is blank when I run the CGI query (cgi-bin/statusjson.cgi?query=programstatus) from main.php manually. I’ve googled this, searched the nagios forums, but everyone else seems to have some log error(s) to give more clues.

I do have one anomaly…

I found another nagios.log which is being touched with just a couple of lines each time the service is started:

# cat /usr/local/nagios/var/nagios.log
[1431088940] Error: Cannot open main configuration file '/' for reading!
[1431088940] Error: Failed to process config file '/'. Aborting

Perhaps something wacky with the init or cfg files, but I can’t find it.
As another test, I can su to nagios and run the daemon manually.

su - nagios
[nagios@atlas ~]$ /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Nagios 4.0.8 starting... (PID=23234)
Local time is Fri May 08 13:45:12 ADT 2015
nerd: Channel hostchecks registered successfully
nerd: Channel servicechecks registered successfully
nerd: Channel opathchecks registered successfully
nerd: Fully initialized and ready to rock!
wproc: Successfully registered manager as @wproc with query handler
wproc: Registry request: name=Core Worker 23235;pid=23235
wproc: Registry request: name=Core Worker 23236;pid=23236
wproc: Registry request: name=Core Worker 23237;pid=23237
wproc: Registry request: name=Core Worker 23238;pid=23238
wproc: Registry request: name=Core Worker 23239;pid=23239
wproc: Registry request: name=Core Worker 23240;pid=23240
Successfully launched command file worker with pid 23241

I hoped this would avoid anything odd in the init script. It does not touch the /usr/local/nagios/var/nagios.log (expected), but it does not change the error from the web site cgis. Another clue is that when the nagios is started manually like this, I don’t see any logging on the screen of hosts and status items. If I launch the init, there are some warnings on some host performance, flapping and the usual chatter from nagios logs, but it is not saying anymore than the above when started from command line as nagios user.


Posted by Shepherd 2019-03-27T17:21:35Z

Greetings

CENTOS 7

Nagios installed as per instructions on nagios website. 

Upgraded to 4.4.3 recently and i get:

 Unable to get process status

Whoops!

Error: Could not read host and service status information!

——————————————————————————————-  

both the upgrade an initial installation were done by the book from instructions on Nagios website.

Any assistance would be greatly appreciated.

thank you.

7 Replies

  • Author Jesse Baker

    JFEB


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    What happens if you run this in the terminal, does it come back saying your config is good?

    BASH

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


    Was this post helpful?
    thumb_up
    thumb_down

  • Greetings, and thank you for your response.   Below is the output of the typed command.

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

    Nagios Core 4.4.3
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 2019-01-15
    License: GPL

    Website: https://www.nagios.org Opens a new window
    Reading configuration data…
      Read main config file okay…
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file ‘/usr/local/nagios/etc/servers/check_mk_templates.cfg’, starting at line 88)
    Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file ‘/usr/local/nagios/etc/servers/check_mk_templates.cfg’, starting at line 157)
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
    WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
    WARNING: The retry_check_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.
      Read object config files okay…

    Running pre-flight check on configuration data…

    Checking objects…
            Checked 172 services.
            Checked 157 hosts.
            Checked 9 host groups.
            Checked 0 service groups.
            Checked 3 contacts.
            Checked 4 contact groups.
            Checked 41 commands.
            Checked 6 time periods.
            Checked 0 host escalations.
            Checked 0 service escalations.
    Checking for circular paths…
            Checked 157 hosts
            Checked 0 service dependencies
            Checked 0 host dependencies
            Checked 6 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
    [root@admin710 ~]#


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Jesse Baker

    JFEB


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    Well the nagios.cfg can see that everything is there. The check_interval thing is fine, that will still work even though the command has changed and is something you can work on changing later.

    Inside /usr/local/nagios/etc/nagios.cfg, check to make sure that it still has these lines:

    Text

    # STATUS FILE
    # This is where the current status of all monitored services and
    # hosts is stored.  Its contents are read and processed by the CGIs.
    # STATUS FILE
    # This is where the current status of all monitored services and
    # hosts is stored.  Its contents are read and processed by the CGIs.
    # The contents of the status file are deleted every time Nagios
    #  restarts.
    
    status_file=/usr/local/nagios/var/status.dat
    
    
    
    # STATUS FILE UPDATE INTERVAL
    # This option determines the frequency (in seconds) that
    # Nagios will periodically dump program, host, and
    # service status data.
    
    status_update_interval=10
    

    And check that status.dat is actually in that directory and can be accessed by Nagios.

    Text

    ls -la /usr/local/nagios/var/status.dat
    

    should look like this:

    Text

    -rw-rw-r-- 1 nagios nagios 362604 Mar 27 14:47 /usr/local/nagios/var/status.dat
    


    Was this post helpful?
    thumb_up
    thumb_down

  • Ok.  there’s a light at the end of the tunnel.  Check out the output.

    ls -la /usr/local/nagios/var/status.dat
    ls: cannot access /usr/local/nagios/var/status.dat: No such file or directory
    [root@admin710 ~]#

    How do i get this file back in there?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Jesse Baker

    JFEB


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    That file is supposed to be automatically generated by nagios, I can’t make one for you or share one as it contains tons of info about your nagios’ status. It’s possible that maybe permissions are messed up and nagios doesn’t/didn’t have permission to write in that directory anymore. What do the permissions look like for your /usr/local/nagios directory and the /usr/local/nagios/var directory?


    Was this post helpful?
    thumb_up
    thumb_down

  • Thank you for your suggestions.  I dropped back and punted and did a complete reinstall of ver. 4.4.3 and by some miracle it all came back.  I have to edit a few files to introduce my switches and printers and such, but it’s working and showing checks. 

    Thank you again!


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Jesse Baker

    JFEB


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    No problem, glad it worked out.


    Was this post helpful?
    thumb_up
    thumb_down

Модератор: SLEDopit

Potia

Сообщения: 86
Контактная информация:

Nagios

Помогите, что-то я не пойму что он от меня хочет

Код: Выделить всё

Nagios 1.1
Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
Last Modified: 06-02-2003
License: GPL

Nagios 1.1 starting... (PID=12395)
Error: Host '192.168.0.6' specified in service 'SMTP' not defined anywhere!
Warning: Host 'mail' has no services associated with it!
Bailing out due to errors encountered while running the pre-flight check.  Run Nagios from the command line with the -v option to verify your config before restarting. (PID=12395)

Вот конфиги

hosts

Код: Выделить всё

define host{
name generic-host
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}

define host{
use generic-host
host_name mail
alias Mail Server
address 192.168.0.6
check_command check_smtp
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}

services

Код: Выделить всё

# Описываем шаблон сервиса
define service{
name generic-service
# Имя шаблона
active_checks_enabled 1
# Включить активные проверки
passive_checks_enabled 1
# Принимать результаты пассивных проверок
parallelize_check 1
# Активные проверки лучше выполнять паралельно,
# такой подход повышает скорость работы
obsess_over_service 0
# Эту опцию стоит включать только при создании распределенной 
# системы мониторинга.
check_freshness 0
# Следить за свежестью результатов проверок. По умолчанию отключено
notifications_enabled 1
# Уведомления включены
event_handler_enabled 1
# Включить обработчики событий
flap_detection_enabled 1
# Использовать обнаружение мерцания
process_perf_data 1
# Собирать данне об эффективности выполнения проверок
retain_status_information 1
# Сохранять информацию о статусе между перезапусками Nagios
retain_nonstatus_information 1
register 0
#  Запрещаем регистрировать это описание как сервис
}

define service{
use generic-service
host_name 192.168.0.6
service_description SMTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admin
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
}

Potia

Сообщения: 86
Контактная информация:

Re: Nagios

Сообщение

Potia » 04.01.2005 14:06

Ошибка ясна. Все запустил. Только проблемы с веб интерфейсом. Пишет

Код: Выделить всё

Whoops!
Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you've just installed things, make sure you read the documentation on starting Nagios.

Some other things you should check in order to resolve this error include:


Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios!
Make sure you've compiled the main program and the CGIs to use the same status data storage options (i.e. text file or database). If the main program is storing status data in a text file and the CGIs are trying to read status data from a database, you'll have problems.

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.

Potia

Сообщения: 86
Контактная информация:

Re: Nagios

Сообщение

Potia » 05.01.2005 14:34

Логи пустые

Код: Выделить всё

[1104836271] Nagios 1.1 starting... (PID=11576)
[1104847071] Auto-save of retention data completed successfully.
[1104850671] Auto-save of retention data completed successfully.
[1104854271] Auto-save of retention data completed successfully.
[1104923675] Nagios 1.1 starting... (PID=12989)

Код: Выделить всё

# Nagios 1.1 Status File
[1104923735] PROGRAM;1104923675;12989;0;0;0;1;1;1;1;0;0;1;0
[1104923735] HOST;mail;UP;1104836571;1104836571;0;87104;0;0;0;0;1;1;1;1;0;0.00;0;1;1;(Host assumed to be up)
[1104923735] SERVICE;mail;SMTP;OK;1/3;HARD;1104853972;1104923975;ACTIVE;1;1;1;1104836571;0;OK;87104;0;0;0;0;0;1;0;0;
1;0;0.00;0;1;1;1;SMTP OK - 5 second response time

Код: Выделить всё

# Nagios 1.1 Retention File
CREATED: 1104854271
PROGRAM: 1;1;1;1;0;0;1;0
HOST: mail;0;1104836571;1;17700;0;0;0;0;1;1;0;1;1;1;1104836571;(Host assumed to be up)
SERVICE: mail;SMTP;0;1104853972;0;17700;0;0;0;0;0;1;1;1;1;0;1;1;1;1;1104836571;SMTP OK - 5 second response time

А вот сам конфиг

Код: Выделить всё

log_file=/usr/local/nagios/var/nagios.log
cfg_file=/usr/local/nagios/etc/checkcommands.cfg
cfg_file=/usr/local/nagios/etc/misccommands.cfg
cfg_file=/usr/local/nagios/etc/contactgroups.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/dependencies.cfg
cfg_file=/usr/local/nagios/etc/escalations.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
cfg_file=/usr/local/nagios/etc/timeperiods.cfg
resource_file=/usr/local/nagios/etc/resource.cfg
status_file=/usr/local/nagios/var/status.log
nagios_user=nagios
nagios_group=nagios
check_external_commands=0
#command_check_interval=1
#command_check_interval=15s
command_check_interval=-1
command_file=/usr/local/nagios/var/rw/nagios.cmd
comment_file=/usr/local/nagios/var/comment.log
downtime_file=/usr/local/nagios/var/downtime.log
lock_file=/usr/local/nagios/var/nagios.lock
temp_file=/usr/local/nagios/var/nagios.tmp
log_rotation_method=d
log_archive_path=/usr/local/nagios/var/archives
use_syslog=1
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_service_checks=1
#global_host_event_handler=somecommand
#global_service_event_handler=somecommand
inter_check_delay_method=s
service_interleave_factor=s
max_concurrent_checks=0
service_reaper_frequency=10
sleep_time=1
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
retain_state_information=1
state_retention_file=/usr/local/nagios/var/status.sav
retention_update_interval=60
use_retained_program_state=0
interval_length=60
use_agressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=0
#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata
obsess_over_services=0
#ocsp_command=somecommand
check_for_orphaned_services=0
check_service_freshness=1
freshness_check_interval=60
aggregate_status_updates=1
status_update_interval=15
enable_flap_detection=0
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=euro
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
admin_email=potia@skying.ru
admin_pager=pagenagios

vitalik_d

Сообщения: 3

Re: Nagios

Сообщение

vitalik_d » 09.02.2005 15:28

Попробуй запустить в режиме отладки и посмотреть сообщения /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg. Похоже что у тебя грабли с конфами особенно проверь host.cfg, hostgroups.cfg, service.cfg

Hi all,

I have 3 CactiEZ running on different servers, in all of them i have the same issue when trying to start the embedded Nagios that comes in this CD.

This is the message when i point to <server_ip>/nagios

Whoops!

Error: Could not read host and service status information!

So searching in google i find some possible solutions:

«go to console and try «/usr/bin/nagios -v /etc/nagios/nagios.cfg» and see the output

At first i got this error:

Error: Cannot open config file ‘/etc/nagios/misccommands.cfg’ for reading: No such file or directory
Error processing object config files!

and in another site i found how to create that file and what put on it so i did it:

# ‘host-notify-by-email’ command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf «%b» «***** Nagios 2.6 *****nnNotification Type: $NOTIFICATIONTYPE$nHost: $HOSTNAME$nState: $HOSTSTATE$nAddress: $HOSTADDRESS$nInfo: $HOSTOUTPUT$nnDate/Time: $LONGDATETIME$n» | /bin/mail -s «Host $HOSTSTATE$ alert for $HOSTNAME$!» $CONTACTEMAIL$
}

# ‘host-notify-by-epager’ command definition
define command{
command_name host-notify-by-epager
command_line /usr/bin/printf «%b» «Host ‘$HOSTALIAS$’ is $HOSTSTATE$nInfo: $HOSTOUTPUT$nTime: $LONGDATETIME$» | /bin/mail -s «$NOTIFICATIONTYPE$ alert — Host $HOSTNAME$ is $HOSTSTATE$» $CONTACTPAGER$
}

# ‘notify-by-email’ command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf «%b» «***** Nagios 2.6 *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVICEDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $LONGDATETIME$nnAdditional Info:nn$SERVICEOUTPUT$» | /bin/mail -s «** $NOTIFICATIONTYPE$ alert — $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **» $CONTACTEMAIL$
}

# ‘notify-by-epager’ command definition
define command{
command_name notify-by-epager
command_line /usr/bin/printf «%b» «Service: $SERVICEDESC$nHost: $HOSTNAME$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nInfo: $SERVICEOUTPUT$nDate: $LONGDATETIME$» | /bin/mail -s «$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$» $CONTACTPAGER$
}

Then the error and warning disappear:

[[email protected] /]# /usr/bin/nagios -v /etc/nagios/nagios.cfg

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data…
Warning: comment_file variable ignored. Comments are now stored in the status and retention files.
Warning: downtime_file variable ignored. Downtime entries are now stored in the status and retention files.
Warning: aggregate_status_updates directive ignored. All status file updates are now aggregated.
Read main config file okay…
Processing object config file ‘/etc/nagios/checkcommands.cfg’…
Processing object config file ‘/etc/nagios/misccommands.cfg’…
Processing object config file ‘/etc/nagios/minimal.cfg’…
Read object config files okay…

Running pre-flight check on configuration data…

Checking services…
Checked 5 services.
Checking hosts…
Checked 1 hosts.
Checking host groups…
Checked 1 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 20 commands.
Checking time periods…
Checked 1 time periods.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors: 0

Things look okay — No serious problems were detected during the pre-flight check

But now when i point again to the nagios server its says:

Whoops!

Error: Could not read host and service status information!

and i tried to run Nagios from console but it fails:

[[email protected] /]# /etc/init.d/nagios start
nagios is stopped
Starting nagios: [FAILED]

Just dont know what to do now… its really strange because it happens in three different servers and they are all clean installs from CactiEZ CD. Bytheway, Cacti is working fine with lots of hosts graphs and weathermaps.

Any ideas what to try next?

Понравилась статья? Поделить с друзьями:
  • Na camw error ciplus 0015
  • Na cama error ciplus 0015 триколор тв
  • N5i ошибка eberspacher
  • N201006 ошибка загрузки
  • N aurl запрещен к индексированию тегом noindex как исправить