Nagios Start FAILED

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.
Kira1987
Posts: 9
Joined: Mon Sep 19, 2016 9:55 pm

Nagios Start FAILED

Post by Kira1987 »

[root@NagiosServer ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.2.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 09-06-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 452 (Check result path '/usr/local/nagios/var/spool/checkresults' is not a valid directory)
Error processing main config file!


#Please help me solve this issues.
Kira1987
Posts: 9
Joined: Mon Sep 19, 2016 9:55 pm

Nagios Start FAILED

Post by Kira1987 »

Hi !
Newly I'm trying to configure monitor server with CentOS 7. I installed Nagios-4.2.1 primarily. Before server restart the nagios service was run good. but after restarting the server Nagios Service failed start. please help me for correct. :!:

Nagios Core 4.2.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 09-06-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 452 (Check result path '/usr/local/nagios/var/spool/checkresults' is not a valid directory)
Error processing main config file!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Start FAILED

Post by mcapra »

Can you show us the contents of your /usr/local/nagios/etc/nagios.cfg file?

Can you also share the outputs of:

Code: Select all

ls -al /usr/local/nagios/var/
ls -al /usr/local/nagios/var/spool/
Former Nagios employee
https://www.mcapra.com/
Kira1987
Posts: 9
Joined: Mon Sep 19, 2016 9:55 pm

Re: Nagios Start FAILED

Post by Kira1987 »

[root@NagiosServer Desktop]# ls -al /usr/local/nagios/var/
total 4
drwxr-xr-x 2 nagios nagios 30 Sep 22 08:33 .
drwxr-xr-x 9 root root 87 Sep 20 10:51 ..
-rw-r--r-- 1 nagios nagios 255 Sep 22 08:33 nagios.configtest
[root@NagiosServer Desktop]# ls -al /usr/local/nagios/var/spool/
ls: cannot access /usr/local/nagios/var/spool/: No such file or directory
[root@NagiosServer Desktop]#

--Thanks and waiting your reply.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Start FAILED

Post by tmcdonald »

Can you show us the contents of your /usr/local/nagios/etc/nagios.cfg file as requested by @mcapra in his last post?
Former Nagios employee
Kira1987
Posts: 9
Joined: Mon Sep 19, 2016 9:55 pm

Re: Nagios Start FAILED

Post by Kira1987 »

Here with I attached the file.
Attachments
nagios.cfg
/usr/local/nagios/etc/nagios.cfg
(43.78 KiB) Downloaded 374 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Start FAILED

Post by rkennedy »

I believe something failed during install. Just compared this to a stock system I spun up yesterday -

Code: Select all

check_result_path=/usr/local/nagios/var/spool/checkresults

Code: Select all

root@localhost:/usr/local/nagios/etc# ls -al /usr/local/nagios/var
total 100
drwxrwxr-x 5 nagios nagios  4096 Sep 23 10:42 .
drwxr-xr-x 9 root   root    4096 Sep 20 11:49 ..
drwxrwxr-x 2 nagios nagios  4096 Sep 22 23:59 archives
-rw-r--r-- 1 nagios nagios    34 Sep 22 14:27 nagios.configtest
-rw-r--r-- 1 nagios nagios     5 Sep 22 14:18 nagios.lock
-rw-r--r-- 1 nagios nagios  1782 Sep 23 10:27 nagios.log
-rw-r--r-- 1 nagios nagios     6 Sep 23 09:47 nrpe.pid
-rw-r--r-- 1 nagios nagios 12663 Sep 22 14:27 objects.cache
-rw-r--r-- 1 nagios nagios 12663 Sep 22 14:27 objects.precache
-rw------- 1 nagios nagios 13147 Sep 23 10:27 retention.dat
drwxrwsr-x 2 nagios nagcmd  4096 Sep 22 14:27 rw
drwxr-xr-x 3 root   root    4096 Sep 20 11:34 spool
-rw-rw-r-- 1 nagios nagios 13580 Sep 23 10:42 status.dat
You are missing quite a bit of files / folders that should have been created. What instructions did you follow during install? It might be worth starting fresh, and follow our official documentation as these as they should work perfectly - https://assets.nagios.com/downloads/nag ... Source.pdf
Former Nagios Employee
Kira1987
Posts: 9
Joined: Mon Sep 19, 2016 9:55 pm

Re: Nagios Start FAILED

Post by Kira1987 »

Dear Sir,
My problem is same.
I followed you given official document step by step. The problem is when fresh installation the service working good. but after rebooting system it will not work. same error. please kindly help me. The system running on VM on server 2012.
New Bitmap Image.jpg
New Bitmap Image (2).jpg
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Start FAILED

Post by tgriep »

Can you login as root to the Nagios server, run the following commands and post the output?

Code: Select all

ls -al /usr/local/nagios/
ls -al /usr/local/nagios/var/
ls -al /usr/local/nagios/var/spool/
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: Nagios Start FAILED

Post by nozlaf »

have you by any chance followed a guide that told you how to setup a ram disk to give better performance in nagios?
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
Locked