Page 1 of 1

host nagios

Posted: Wed Aug 26, 2015 6:19 am
by limagios
Hi everybody,

I have a problem. When i configure a host in /usr/local/nagios/etc/objects/switch.cfg I put all the appropriate values for the switch. I also change in the configuration of nagios the # in the next line:
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg and finally i reload nagios.
But when i try to access in host nagios via web this error appear:
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.
So I check configuration and its okay:
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 12 services.
Checked 2 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0
And in logs:
[1440448177] Nagios 4.0.4 starting... (PID=19415)
[1440448177] Local time is Mon Aug 24 22:29:37 CEST 2015
[1440448177] LOG VERSION: 2.0
[1440448177] qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. bind() failed: No such file or directory
[1440448177] Error: Failed to initialize query handler. Aborting
[1440583522] Nagios 4.0.4 starting... (PID=852)
[1440583522] Local time is Wed Aug 26 12:05:22 CEST 2015
[1440583522] LOG VERSION: 2.0
[1440583522] qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. bind() failed: No such file or directory
[1440583522] Error: Failed to initialize query handler. Aborting
[1440586045] Nagios 4.0.4 starting... (PID=4119)
[1440586045] Local time is Wed Aug 26 12:47:25 CEST 2015
[1440586045] LOG VERSION: 2.0
[1440586045] qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. bind() failed: No such file or directory
[1440586045] Error: Failed to initialize query handler. Aborting
I also do the next solution but it keeps on not work. https://support.nagios.com/forum/viewto ... =7&t=22141

Can somebody help me?

Thanks

Re: host nagios

Posted: Wed Aug 26, 2015 9:14 am
by hsmith
Did you upgrade from an old version, or have you been on this version the whole time?

Re: host nagios

Posted: Wed Aug 26, 2015 10:58 am
by limagios
I have been un this version all time

Re: host nagios

Posted: Wed Aug 26, 2015 11:10 am
by hsmith
Can you post your nagios.cfg for us to review?

Re: host nagios

Posted: Wed Aug 26, 2015 3:22 pm
by limagios
Sure,

Re: host nagios

Posted: Wed Aug 26, 2015 3:33 pm
by hsmith
limagios wrote:Sure,
How's the output of a ls -l /usr/local/nagios/var/rw look?

From your config...nagios_group=nagios3 is there a reason the group isn't just "nagios" ?

Re: host nagios

Posted: Thu Aug 27, 2015 4:04 am
by limagios
Hi,

When I put:

Code: Select all

root@nagios-VirtualBox:/home/nagios# ls -l /usr/local/nagios/var
total 36
drwxrwxr-x 2 nagios nagios   4096 ago 24 22:24 archives
-rw-r--r-- 1 nagios nagios3     4 ago 27 10:50 nagios.lock
-rw-r--r-- 1 nagios nagios3  2870 ago 27 10:50 nagios.log
-rw-r--r-- 1 nagios nagios  16769 ago 27 10:50 objects.precache
-rw-rw-r-- 1 nagios nagios      0 ago 27 10:50 retention.dat
drwxr-xr-x 3 nagios nagios   4096 ago 24 22:24 spool
root@nagios-VirtualBox:/home/nagios# 
I dont have the folder rw.
And I change the nagios_group in the nagios.cfg file, I put nagios_group=nagios even so the error persists.

Re: host nagios

Posted: Thu Aug 27, 2015 12:29 pm
by jdalrymple
Create the rw folder, make nagios.nagios the owner:

Code: Select all

mkdir /usr/local/nagios/var/rw
chown nagios.nagios /usr/local/nagios/var/rw

Re: host nagios

Posted: Fri Aug 28, 2015 3:57 am
by limagios
I´ve done the recommendations of @jdalrymple , reload nagios and its works.

Thanks :mrgreen:

Re: host nagios

Posted: Fri Aug 28, 2015 9:12 am
by hsmith
limagios wrote:I´ve done the recommendations of @jdalrymple , reload nagios and its works.

Thanks :mrgreen:
Yay! Are we all right to mark this one as resolved and close the topic, or is there anything else we can help you with?