host nagios

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.
Locked
limagios
Posts: 9
Joined: Sat Aug 22, 2015 6:16 am

host nagios

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: host nagios

Post by hsmith »

Did you upgrade from an old version, or have you been on this version the whole time?
Former Nagios Employee.
me.
limagios
Posts: 9
Joined: Sat Aug 22, 2015 6:16 am

Re: host nagios

Post by limagios »

I have been un this version all time
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: host nagios

Post by hsmith »

Can you post your nagios.cfg for us to review?
Former Nagios Employee.
me.
limagios
Posts: 9
Joined: Sat Aug 22, 2015 6:16 am

Re: host nagios

Post by limagios »

Sure,
Attachments
nagios.cfg
(43.43 KiB) Downloaded 371 times
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: host nagios

Post 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" ?
Former Nagios Employee.
me.
limagios
Posts: 9
Joined: Sat Aug 22, 2015 6:16 am

Re: host nagios

Post 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.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: host nagios

Post 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
limagios
Posts: 9
Joined: Sat Aug 22, 2015 6:16 am

Re: host nagios

Post by limagios »

I´ve done the recommendations of @jdalrymple , reload nagios and its works.

Thanks :mrgreen:
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: host nagios

Post 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?
Former Nagios Employee.
me.
Locked