Page 1 of 1

Failed to start LSB: start and stop Nagios monitoring server

Posted: Tue Jul 26, 2016 5:43 am
by hack3rcon
Hello.
Why I got below error on fedora 23 server when I use "systemctl start nagios.service" ?

Code: Select all

[root@localhost etc]# systemctl status nagios.service
● nagios.service - LSB: start and stop Nagios monitoring server
   Loaded: loaded (/etc/rc.d/init.d/nagios)
   Active: failed (Result: resources) since Tue 2016-07-26 06:18:03 EDT; 8s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2451 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)

Jul 26 06:18:03 localhost.localdomain systemd[1]: Starting LSB: start and stop Nagios monitoring server...
Jul 26 06:18:03 localhost.localdomain nagios[2451]: nagios dead but subsys locked
Jul 26 06:18:03 localhost.localdomain nagios[2451]: runuser: warning: cannot change directory to /var/spool/nagios: No such file or directory
Jul 26 06:18:03 localhost.localdomain runuser[2512]: pam_unix(runuser:session): session opened for user nagios by (uid=0)
Jul 26 06:18:03 localhost.localdomain nagios[2517]: Nagios 4.0.1 starting... (PID=2517)
Jul 26 06:18:03 localhost.localdomain nagios[2451]: Starting nagios: [  OK  ]
Jul 26 06:18:03 localhost.localdomain systemd[1]: nagios.service: PID file /var/nagios/nagios.pid not readable (yet?) after start: No such file or directory
Jul 26 06:18:03 localhost.localdomain systemd[1]: Failed to start LSB: start and stop Nagios monitoring server.
Jul 26 06:18:03 localhost.localdomain systemd[1]: nagios.service: Unit entered failed state.
Jul 26 06:18:03 localhost.localdomain systemd[1]: nagios.service: Failed with result 'resources'.

Re: Failed to start LSB: start and stop Nagios monitoring se

Posted: Tue Jul 26, 2016 9:49 am
by rkennedy
Did you follow a specific guide when installing? Can you show us which one?

We have a few official guides available here - https://support.nagios.com/kb/category.php?id=58

It looks like there is a permission issue in the /var/nagios/ folder.

Re: Failed to start LSB: start and stop Nagios monitoring se

Posted: Wed Jul 27, 2016 12:24 am
by hack3rcon

Re: Failed to start LSB: start and stop Nagios monitoring se

Posted: Wed Jul 27, 2016 1:15 pm
by rkennedy

Code: Select all

curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
The instructions you posted are for Core 4.1.1, but you have 4.0.1 installed -
[/quote]
Jul 26 06:18:03 localhost.localdomain nagios[2517]: Nagios 4.0.1 starting... (PID=2517)
[/quote]

Rather then troubleshoot what has actually happened on this system, it's most likely faster to re-image and install once again. Start fresh with a clean, minimal machine. If you can use CentOS 7, feel free to use a guide I wrote here - https://assets.nagios.com/downloads/nag ... entos7.pdf

Otherwise, take a look at our official guides - https://support.nagios.com/kb/category.php?id=58

Re: Failed to start LSB: start and stop Nagios monitoring se

Posted: Wed Mar 21, 2018 6:39 pm
by charpham
Hmm.. I am baffled by this.. I have made all these adjustments, I still have the same problem.. thanks for all your help I really appreciate.. I beginning to wonder if there might a more "recent" plugin that will do the same..

Here is my pre-flight check
[root@terminus objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL

Website: https://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...
Error: Service check command 'check_interface_table_v3t.pl -H charpham-3548-1 -C v14tual -2 -f --cachedir /usr/local/nagios/etc/.ifCache' specified in service 'Interface status' for host 'charpham-3548' not defined anywhere!
Checked 40 services.
Checked 8 hosts.
Checked 3 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 27 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 8 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: 1

Here are the permissions for the cachedir
[root@terminus etc]# ls -al
total 140
drwxrwxr-x. 4 nagios nagios 168 Mar 19 12:41 .
drwxr-xr-x. 9 root root 94 Jan 5 15:29 ..
-rw-rw-r-- 1 nagios nagios 12999 Jan 23 14:14 cgi.cfg
-rw-rw-r--. 1 nagios nagios 12999 Dec 21 14:17 cgi.cfg~
-rw-r--r--. 1 root root 50 Dec 26 15:13 htpasswd.users
drwxrwxrwx 3 nagios nagios 22 Mar 19 12:41 .ifCache
-rw-rw-r-- 1 nagios nagios 45175 Jan 21 16:00 nagios.cfg
-rw-rw-r--. 1 nagios nagios 44816 Dec 21 14:17 nagios.cfg~
drwxrwxr-x. 2 nagios nagios 4096 Mar 21 16:23 objects
-rw-rw---- 1 nagios nagios 1312 Dec 26 15:12 resource.cfg
-rw-rw----. 1 nagios nagios 1312 Dec 21 14:17 resource.cfg~

[root@terminus etc]# cd .ifCache
[root@terminus .ifCache]# ls -l
total 0
drwxrwxrwx 4 nagios nagios 41 Mar 19 12:41 10.1.0.2

here is my nagios.cfg - note the
# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
# host groups, contacts, contact groups, services, etc.
# You can split your object definitions across several config files
# if you wish (as shown below), or keep them all in a single config file.



# Definitions for monitoring a router/switch
cfg_file=/usr/local/nagios/etc/objects/switch.cfg
cfg_file=/usr/local/nagios/etc/objects/charpham-3548.cfg

Re: Failed to start LSB: start and stop Nagios monitoring se

Posted: Thu Mar 22, 2018 11:24 am
by kyang
Hello charpham,

We would like to try and keep threads that are this old to not be revived.

If you are having a different issue, then we would ask that you could create a new topic in regards to your new issue.

However, you have posted the same question in your previous thread.

https://support.nagios.com/forum/viewto ... 495#245487

I will answer it in there.

Closing this thread now.