FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2013
    Location
    HU
    Posts
    85

    nagios "Error: Could not read object configuration data!"

    Hi!

    I use a Fedora 20 arm (Raspberry Pi - pidora) and installed nagios, httpd.
    The "nagios -v /etc/nagios/nagios.cfg" command is ok, no error. Nagios is running.

    If I browse the nagios page in web browser (http://machinename.lan/nagios) then I can login with nagios admin user. But if I click on any menu item on side left (Map,Host,Service) then I get this error:
    -------------------------------------------------------------
    Whoops!

    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.
    -------------------------------------------------------------


    The httpd.d/nagios.conf:
    Code:
    ScriptAlias /nagios/cgi-bin/ "/usr/lib/nagios/cgi-bin/"
    
    # SSLRequireSSL
    Options ExecCGI
    AllowOverride None
    
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios/passwd
    
    # Apache 2.4
    
    Require all granted
    # Require local
    Require valid-user
    
    # Apache 2.2
    Order allow,deny
    Allow from all
    # Order deny,allow
    # Deny from all
    # Allow from 127.0.0.1
    Require valid-user
    
    Alias /nagios "/usr/share/nagios/html"
    
    # SSLRequireSSL
    Options None
    AllowOverride None
    
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios/passwd
    
    # Apache 2.4
    
    Require all granted
    # Require local
    Require valid-user
    
    # Apache 2.2
    Order allow,deny
    Allow from all
    # Order deny,allow
    # Deny from all
    # Allow from 127.0.0.1
    Require valid-user

    I see in httpd error_log:
    [auth_basic:error] [pid 1145] [client 192.168.1.70:46994] AH01618: user backup not found: /nagios/cgi-bin//status.cgi
    [auth_basic:error] [pid 1145] [client 192.168.1.70:46994] AH01618: user backup not found: /nagios/js/jquery-1.7.1.min.js, referer: http://machinename.lan/nagios/cgi-bi...&style=summary
    [auth_basic:error] [pid 1193] [client 192.168.1.70:46997] AH01618: user backup not found: /nagios/cgi-bin//statusmap.cgi, referer: http://machinename.lan/nagios/side.php

    Code:
    ~# ls -l /etc/|grep nagios
    drwxrwxr-x   5 root     root       4096 aug    9 10:11 nagios
    
    ~# ls -l /etc/nagios/
    -rw-rw-r-- 1 root root   11658 aug    9 10:11 cgi.cfg
    drwxr-x--- 2 root nagios  4096 febr   8  2014 conf.d
    -rw-r--r-- 1 root root    1036 febr  21  2011 generic-service.cfg
    -rw-r--r-- 1 root root     764 nov    9  2013 lcgdm-commands.cfg
    -rw-r--r-- 1 root root     282 aug   16  2011 lcgdm-hosts.cfg
    -rw-r--r-- 1 root root    3322 máj   25  2012 lcgdm-services.cfg
    -rw-rw-r-- 1 root root   44540 febr   8  2014 nagios.cfg
    -rw-r--r-- 1 root root    7933 febr   5  2014 nrpe.cfg
    drwxr-x--- 2 root nagios  4096 aug    9 09:23 objects
    -rw-r----- 1 root apache    71 aug    9 10:05 passwd
    drwxr-x--- 2 root nagios  4096 aug    9 09:13 private

    I don't understand why the user 'backup' is in log, because I login with user 'nagiosadmin'.


    I think it is permission problem, but I don't know where it is.
    Last edited by makgab; 10th August 2015 at 06:00 AM. Reason: [SOLVED]

  2. #2
    Join Date
    Jan 2010
    Posts
    7,279

    Re: nagios "Error: Could not read object configuration data!"

    As it says in the message, try nagios -v on the nagios.conf file. It's an easy file to mess up with a typo, and often, nagios -v will give you the line where you made the error with some sort of explanation.

  3. #3
    Join Date
    Sep 2013
    Location
    HU
    Posts
    85

    Re: nagios "Error: Could not read object configuration data!"

    Quote Originally Posted by smr54
    As it says in the message, try nagios -v on the nagios.conf file. It's an easy file to mess up with a typo, and often, nagios -v will give you the line where you made the error with some sort of explanation.
    My second sentence was that: "nagios -v nagios.cfg" command is ok, no error!
    Code:
    nagios -v /etc/nagios/nagios.cfg 
    
    Nagios Core 3.5.1
    Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 08-30-2013
    License: GPL
    
    Website: http://www.nagios.org
    Reading configuration data...
       Read main config file okay...
    Processing object config file '/etc/nagios/objects/commands.cfg'...
    Processing object config file '/etc/nagios/objects/contacts.cfg'...
    Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
    Processing object config file '/etc/nagios/objects/templates.cfg'...
    Processing object config file '/etc/nagios/objects/localhost.cfg'...
    Processing object config directory '/etc/nagios/conf.d'...
       Read object config files okay...
    
    Running pre-flight check on configuration data...
    
    Checking services...
    	Checked 9 services.
    Checking hosts...
    	Checked 2 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 24 commands.
    Checking time periods...
    	Checked 5 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

  4. #4
    Join Date
    Jan 2010
    Posts
    7,279

    Re: nagios "Error: Could not read object configuration data!"

    So you did. Sorry, overlooked that.
    I haven't worked with nagios in over a year and a half, but the CentOS wiki article was the best that I've found.

    You can see if it's an SELinux or firewall issue by temporarily disabling them. (One at a time--you can just run setenforce 0 to temporarily disable SELinux)

    Putting that error message about configuration data brings this up I don't know if it's useful.
    http://stackoverflow.com/questions/2...iguration-data

  5. #5
    Join Date
    Sep 2013
    Location
    HU
    Posts
    85

    Re: nagios "Error: Could not read object configuration data!"

    SELinux and firewall is disabled!

  6. #6
    Join Date
    Sep 2013
    Location
    HU
    Posts
    85

    Re: nagios "Error: Could not read object configuration data!"

    I solved it!
    Solution: permission problem of /var/log/nagios, /var/log/nagios/nagios.log. The apache user cannot access it.

  7. #7
    Join Date
    Jan 2010
    Posts
    7,279

    Re: nagios "Error: Could not read object configuration data!"

    Excellent! Thanks for coming back and letting us know, no doubt this will help someone in the future.

Similar Threads

  1. xen virt-install hangs at "Write protecting the kernel read-only data: 762k"
    By dave- in forum Installation, Upgrades and Live Media
    Replies: 0
    Last Post: 3rd March 2008, 02:47 PM
  2. Replies: 11
    Last Post: 17th December 2007, 05:58 PM
  3. Replies: 4
    Last Post: 30th April 2007, 03:32 PM
  4. Replies: 6
    Last Post: 19th April 2006, 10:28 PM
  5. Replies: 0
    Last Post: 23rd May 2005, 04:59 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •