Page 1 of 2
Nagios & Apache problem
Posted: Mon Feb 10, 2014 9:02 am
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?
Re: Nagios & Apache problem
Posted: Mon Feb 10, 2014 11:12 am
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
Re: Nagios & Apache problem
Posted: Mon Feb 10, 2014 11:31 am
by idefixgallier
Thank you for the answer -
as i posted ... yes nagios is running (its collecting data, sending warning mails/sms, etc) ...
Re: Nagios & Apache problem
Posted: Mon Feb 10, 2014 11:57 am
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?
Lets check the groups settings:
And check if the nagios user is expired:
Re: Nagios & Apache problem
Posted: Mon Feb 10, 2014 12:19 pm
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.
Re: Nagios & Apache problem
Posted: Mon Feb 10, 2014 12:26 pm
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.
Re: Nagios & Apache problem
Posted: Tue Mar 11, 2014 2:15 pm
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
Re: Nagios & Apache problem
Posted: Tue Mar 11, 2014 2:21 pm
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).
Re: Nagios & Apache problem
Posted: Tue Mar 11, 2014 2:44 pm
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
Re: Nagios & Apache problem
Posted: Tue Mar 11, 2014 5:13 pm
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:
To:
Which will half all your check times. Beware that this will DRASTICALLY increase load.