Nagios & Apache problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
idefixgallier
Posts: 10
Joined: Mon Feb 10, 2014 8:57 am

Nagios & Apache problem

Post by idefixgallier »

Hi!

I am using nagios 4.02 on an Ubuntu 12.04 - both were running
for a longer period of time without any issues.

Todays restart of nagios and apache2 (i configured a new iftraffic check) made
nagios running and apache2 running, but each cgi called from the web interface
ends up in:

Error: Could not read object configuration data!

I reinstalled nagios completely, tested the cgi scripts from the command line (with
nagios user, nagcmd user and www-data user) ... tested for errors in the config files, of course
... nothing

nagios.log and apache.log are without any information to that topic....

Any tipss for me?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios & Apache problem

Post by abrist »

idefixgallier wrote: Error: Could not read object configuration data!
Nagios most likely is not running. Try:

Code: Select all

service nagios stop
killall nagios
ps -aef | grep nagios.cfg
service nagios start
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
idefixgallier
Posts: 10
Joined: Mon Feb 10, 2014 8:57 am

Re: Nagios & Apache problem

Post by idefixgallier »

Thank you for the answer -
as i posted ... yes nagios is running (its collecting data, sending warning mails/sms, etc) ...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios & Apache problem

Post by abrist »

But you may have multiple instances, with one hung up. Did you try the above steps at least?
Could you post a tail of your apache log?

Code: Select all

tail -25 /var/log/httpd/error_log
Lets check the groups settings:

Code: Select all

grep nag /etc/group
And check if the nagios user is expired:

Code: Select all

chage -l nagios
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
idefixgallier
Posts: 10
Joined: Mon Feb 10, 2014 8:57 am

Re: Nagios & Apache problem

Post by idefixgallier »

Hi,

yes I restarted nagios, i have restarted the whole server too.
I installed nagios from scretch, I actived a backup from last week,
i checked the user and the usergroups (www-data group and user).
no effect.

There are no hints in the log - i tested the status.cgi and tac.cgi
with the www-data user ... correct html was displayed on the bash
(i disabled authentication before)
I even straced the apache processes ... no evidence of a problem...

In the meantime,i did a complete restore of the whole server from last weekend and
nagios is running again.

I hope that (whatever it was) is not appearing again as really not having
any clue what was happening.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios & Apache problem

Post by abrist »

idefixgallier wrote:In the meantime,i did a complete restore of the whole server from last weekend and
nagios is running again.
That is good to hear, but this is not a solution. Hopefully this does not happen again.
idefixgallier wrote:I hope that (whatever it was) is not appearing again as really not having
any clue what was happening.
The error you experienced is almost always caused by multiple daemons, or permission/group issues. Let us know if this recurs.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
idefixgallier
Posts: 10
Joined: Mon Feb 10, 2014 8:57 am

Re: Nagios & Apache problem

Post by idefixgallier »

I have found the solution - it is possibly a bug in nagios itself:
(and ... its reproducable)

I found the same "error" on my old nagios system and on a completly new system -

when i change the parameter retry_check_interval from integer to float (in my case 1 to 0.5)

Code: Select all

define service{
        use                             generic-service
        host_name                       wwwweb.fhstp.ac.at
        service_description             Webseite_generell
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           1
        retry_check_interval            0.5
        contact_groups                 linux-admins, sms1,graf-server
        notification_interval           120
        notification_period             24x7
nagios is running without any problems (and is doing a 30second retry check interval)
BUT
Error: Could not read object configuration data!
the webinterface is not working any more.
As soon as i change it to 1 (integer) again ... both are working again.

Try it yourself ...

regards
Martin
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios & Apache problem

Post by tmcdonald »

That is not a bug, that is an intentional design decision. If we allowed floats, people would schedule everything as .1 (6 seconds) and this would cause *incredibly* heavy load on the server. It could also lead to divide-by-zero errors where something is scheduled to run every half second (extreme example, but we have had this request).
Former Nagios employee
idefixgallier
Posts: 10
Joined: Mon Feb 10, 2014 8:57 am

Re: Nagios & Apache problem

Post by idefixgallier »

Good point -
but its not very simple for the administrator that nagios itself
is running but the webinterface not (with a not very useful message)

- maybe make a "strong" warning while checking the nagios config
during startup that floating values could lead to web-interface problems...

We are using check_interval 0.3 on our switches for a long time without
having problems with the webinterface so it was suprising that a 0.5 in the retry_check_interval
causes this ...

regards
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios & Apache problem

Post by abrist »

What version of nagios were you using that allowed and used floats in configs?
The better way to do this would be to alter:

Code: Select all

interval_length=60
To:

Code: Select all

interval_length=30
Which will half all your check times. Beware that this will DRASTICALLY increase load.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked