Page 1 of 1

nagios.lock does not exist or is a zombie

Posted: Mon May 01, 2017 3:17 pm
by raulv
I'm testing the new Nagios version before migrate to production. The prod version of Nagios is 5.4.1 so I set vm with Nagios XI with the same version to update to 5.4.4 before that update I just install Nagios xi using the fullinstall script when it finish Nagios is working but when I try to restore a backup from the prod Nagios to the test Nagios the Monitoring Engine doesn't work and display this "No lock file found /usr/local/nagiosxi/var/nagios.lock". The prod Nagios is on centos 6 64 bits and the new one it will be on centos 7 64. I also run the following commands as is indicated when you are going to migrate from one OS version to an other

cd /tmp/nagiosxi
rm -f installed.subcomponents
./A-subcomponents

I also check the that the backup have the nagios.lock file and it have it. I tried to create the file with touch but when Nagios is restarted the nagios.lock file that I create is delete or something like that because I get again the Monitoring Engine error. Somebody have any idea about this problem and how to fix it

Re: nagios.lock does not exist or is a zombie

Posted: Mon May 01, 2017 4:35 pm
by dwhitfield
It sounds like the install did not complete properly.

Can you post your /tmp/nagiosxi/install.log here? What's the output of systemctl restart nagios? If it tells you to run "systemctl status nagios.service" and "journalctl -xe" please post the output of those as well.

From the fresh install, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the Download Profile button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

Also, *if* you have problems with the profile, please post your /usr/local/nagios/var/nagios.log

UPDATE: Profile received and shared with techs

Re: nagios.lock does not exist or is a zombie

Posted: Mon May 01, 2017 5:00 pm
by raulv
I cant send you a PM because this "We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature." So here is the /usr/local/nagios/var/nagios.log

Code: Select all

[1493655387] Nagios 4.2.4 starting... (PID=50969)
[1493655387] Local time is Mon May 01 11:16:27 CDT 2017
[1493655387] LOG VERSION: 2.0
[1493655387] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1493655387] qh: core query handler registered
[1493655387] nerd: Channel hostchecks registered successfully
[1493655387] nerd: Channel servicechecks registered successfully
[1493655387] nerd: Channel opathchecks registered successfully
[1493655387] nerd: Fully initialized and ready to rock!
[1493655387] wproc: Successfully registered manager as @wproc with query handler
[1493655387] wproc: Registry request: name=Core Worker 50974;pid=50974
[1493655387] wproc: Registry request: name=Core Worker 50971;pid=50971
[1493655387] wproc: Registry request: name=Core Worker 50972;pid=50972
[1493655387] wproc: Registry request: name=Core Worker 50973;pid=50973
[1493655387] ndomod: NDOMOD 2.1.2 (11-14-2016) Copyright (c) 2009 Nagios Core Development Team and Community Contributor
s
[1493655387] ndomod: Could not open data sink!  I'll keep trying, but some output may get lost...
[1493655387] ndomod registered for process data
[1493655387] ndomod registered for log data'
[1493655387] ndomod registered for system command data'
[1493655387] ndomod registered for event handler data'
[1493655387] ndomod registered for notification data'
[1493655387] ndomod registered for comment data'
[1493655387] ndomod registered for downtime data'
[1493655387] ndomod registered for flapping data'
[1493655387] ndomod registered for program status data'
[1493655387] ndomod registered for host status data'
[1493655387] ndomod registered for service status data'
[1493655387] ndomod registered for adaptive program data'
[1493655387] ndomod registered for adaptive host data'
[1493655387] ndomod registered for adaptive service data'
[1493655387] ndomod registered for external command data'
[1493655387] ndomod registered for aggregated status data'
[1493655387] ndomod registered for retention data'
[1493655387] ndomod registered for contact data'
[1493655387] ndomod registered for contact notification data'
[1493655387] ndomod registered for acknowledgement data'
[1493655387] ndomod registered for state change data'
[1493655387] ndomod registered for contact status data'
[1493655387] ndomod registered for adaptive contact data'
[1493655387] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1493655387] Successfully launched command file worker with pid 51045
[1493655392] Caught SIGTERM, shutting down...
[1493655392] Successfully shutdown... (PID=50969)
[1493655392] Event broker module 'NERD' deinitialized successfully.
[1493655392] ndomod: Shutdown complete.
[1493655392] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[1493655392] Nagios 4.2.4 starting... (PID=51181)
[1493655392] Local time is Mon May 01 11:16:32 CDT 2017
[1493655392] LOG VERSION: 2.0
[1493655392] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1493655392] qh: core query handler registered
[1493655392] nerd: Channel hostchecks registered successfully
[1493655392] nerd: Channel servicechecks registered successfully
[1493655392] nerd: Channel opathchecks registered successfully
[1493655392] nerd: Fully initialized and ready to rock!
[1493655392] wproc: Successfully registered manager as @wproc with query handler
[1493655392] wproc: Registry request: name=Core Worker 51186;pid=51186
[1493655392] wproc: Registry request: name=Core Worker 51183;pid=51183
[1493655392] wproc: Registry request: name=Core Worker 51184;pid=51184
[1493655392] wproc: Registry request: name=Core Worker 51185;pid=51185
[1493655392] ndomod: NDOMOD 2.1.2 (11-14-2016) Copyright (c) 2009 Nagios Core Development Team and Community Contributor
s
[1493655392] ndomod: Successfully connected to data sink.  349 queued items to flush.
[1493655392] ndomod: Successfully flushed 349 queued items to data sink.
[1493655392] ndomod registered for process data
[1493655392] ndomod registered for log data'
[1493655392] ndomod registered for system command data'
[1493655392] ndomod registered for event handler data'
[1493655392] ndomod registered for notification data'
[1493655392] ndomod registered for comment data'
[1493655392] ndomod registered for downtime data'
[1493655392] ndomod registered for flapping data'
[1493655392] ndomod registered for program status data'
[1493655392] ndomod registered for host status data'
[1493655392] ndomod registered for service status data'
[1493655392] ndomod registered for adaptive program data'
[1493655392] ndomod registered for adaptive host data'
[1493655392] ndomod registered for adaptive service data'
[1493655392] ndomod registered for external command data'
[1493655392] ndomod registered for aggregated status data'
[1493655392] ndomod registered for retention data'
[1493655392] ndomod registered for contact data'
[1493655392] ndomod registered for contact notification data'
[1493655392] ndomod registered for acknowledgement data'
[1493655392] ndomod registered for state change data'
[1493655392] ndomod registered for contact status data'
[1493655392] ndomod registered for adaptive contact data'
[1493655392] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1493655392] Successfully launched command file worker with pid 51198
[1493655906] Caught SIGTERM, shutting down...
[1493655906] Successfully shutdown... (PID=51181)
[1493655906] Event broker module 'NERD' deinitialized successfully.
[1493655906] ndomod: Shutdown complete.
[1493655906] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[1493655946] Nagios 4.2.4 starting... (PID=2433)
[1493655946] Local time is Mon May 01 11:25:46 CDT 2017
[1493655946] LOG VERSION: 2.0
[1493655946] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1493655946] qh: core query handler registered
[1493655946] nerd: Channel hostchecks registered successfully
[1493655946] nerd: Channel servicechecks registered successfully
[1493655946] nerd: Channel opathchecks registered successfully
[1493655946] nerd: Fully initialized and ready to rock!
[1493655946] wproc: Successfully registered manager as @wproc with query handler
[1493655946] wproc: Registry request: name=Core Worker 2437;pid=2437
[1493655946] wproc: Registry request: name=Core Worker 2436;pid=2436
[1493655946] wproc: Registry request: name=Core Worker 2435;pid=2435
[1493655946] wproc: Registry request: name=Core Worker 2434;pid=2434
[1493655946] ndomod: NDOMOD 2.1.2 (11-14-2016) Copyright (c) 2009 Nagios Core Development Team and Community Contributor
s
[1493655946] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1493655946] ndomod registered for process data
[1493655946] ndomod registered for log data'
[1493655946] ndomod registered for system command data'
[1493655946] ndomod registered for event handler data'
[1493655946] ndomod registered for notification data'
[1493655946] ndomod registered for comment data'
[1493655946] ndomod registered for downtime data'
[1493655946] ndomod registered for flapping data'
[1493655946] ndomod registered for program status data'
[1493655946] ndomod registered for host status data'
[1493655946] ndomod registered for service status data'
[1493655946] ndomod registered for adaptive program data'
[1493655946] ndomod registered for adaptive host data'
[1493655946] ndomod registered for adaptive service data'
[1493655946] ndomod registered for external command data'
[1493655946] ndomod registered for aggregated status data'
[1493655946] ndomod registered for retention data'
[1493655946] ndomod registered for contact data'
[1493655946] ndomod registered for contact notification data'
[1493655946] ndomod registered for acknowledgement data'
[1493655946] ndomod registered for state change data'
[1493655946] ndomod registered for contact status data'
[1493655946] ndomod registered for adaptive contact data'
[1493655946] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1493655946] Successfully launched command file worker with pid 2452
[1493656081] Caught SIGTERM, shutting down...
[1493656081] Successfully shutdown... (PID=2433)
[1493656081] Event broker module 'NERD' deinitialized successfully.
[1493656081] ndomod: Shutdown complete.
[1493656081] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[1493656162] Nagios 4.2.4 starting... (PID=2448)
[1493656162] Local time is Mon May 01 11:29:22 CDT 2017
[1493656162] LOG VERSION: 2.0
[1493656162] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1493656162] qh: core query handler registered
[1493656162] nerd: Channel hostchecks registered successfully
[1493656162] nerd: Channel servicechecks registered successfully
[1493656162] nerd: Channel opathchecks registered successfully
[1493656162] nerd: Fully initialized and ready to rock!
[1493656162] wproc: Successfully registered manager as @wproc with query handler
[1493656162] wproc: Registry request: name=Core Worker 2453;pid=2453
[1493656162] wproc: Registry request: name=Core Worker 2450;pid=2450
[1493656162] wproc: Registry request: name=Core Worker 2451;pid=2451
[1493656162] wproc: Registry request: name=Core Worker 2452;pid=2452
[1493656162] ndomod: NDOMOD 2.1.2 (11-14-2016) Copyright (c) 2009 Nagios Core Development Team and Community Contributor
s
[1493656162] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1493656162] ndomod registered for process data
[1493656162] ndomod registered for log data'
[1493656162] ndomod registered for system command data'
[1493656162] ndomod registered for event handler data'
[1493656162] ndomod registered for notification data'
[1493656162] ndomod registered for comment data'
[1493656162] ndomod registered for downtime data'
[1493656162] ndomod registered for flapping data'
[1493656162] ndomod registered for program status data'
[1493656162] ndomod registered for host status data'
[1493656162] ndomod registered for service status data'
[1493656162] ndomod registered for adaptive program data'
[1493656162] ndomod registered for adaptive host data'
[1493656162] ndomod registered for adaptive service data'
[1493656162] ndomod registered for external command data'
[1493656162] ndomod registered for aggregated status data'
[1493656162] ndomod registered for retention data'
[1493656162] ndomod registered for contact data'
[1493656162] ndomod registered for contact notification data'
[1493656162] ndomod registered for acknowledgement data'
[1493656162] ndomod registered for state change data'
[1493656162] ndomod registered for contact status data'
[1493656162] ndomod registered for adaptive contact data'
[1493656162] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1493656162] Successfully launched command file worker with pid 2474
[1493656191] Caught SIGTERM, shutting down...
[1493656191] Successfully shutdown... (PID=2448)
[1493656191] Event broker module 'NERD' deinitialized successfully.
[1493656191] ndomod: Shutdown complete.
[1493656191] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[1493675411] Nagios 4.2.4 starting... (PID=2502)
[1493675411] Local time is Mon May 01 16:50:11 CDT 2017
[1493675411] LOG VERSION: 2.0
[1493675411] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1493675411] qh: core query handler registered
[1493675411] nerd: Channel hostchecks registered successfully
[1493675411] nerd: Channel servicechecks registered successfully
[1493675411] nerd: Channel opathchecks registered successfully
[1493675411] nerd: Fully initialized and ready to rock!
[1493675411] wproc: Successfully registered manager as @wproc with query handler
[1493675411] wproc: Registry request: name=Core Worker 2508;pid=2508
[1493675411] wproc: Registry request: name=Core Worker 2505;pid=2505
[1493675411] wproc: Registry request: name=Core Worker 2506;pid=2506
[1493675411] wproc: Registry request: name=Core Worker 2507;pid=2507
[1493675411] ndomod: NDOMOD 2.1.2 (11-14-2016) Copyright (c) 2009 Nagios Core Development Team and Community Contributor
s
[1493675411] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1493675411] ndomod registered for process data
[1493675411] ndomod registered for log data'
[1493675411] ndomod registered for system command data'
[1493675411] ndomod registered for event handler data'
[1493675411] ndomod registered for notification data'
[1493675411] ndomod registered for comment data'
[1493675411] ndomod registered for downtime data'
[1493675411] ndomod registered for flapping data'
[1493675411] ndomod registered for program status data'
[1493675411] ndomod registered for host status data'
[1493675411] ndomod registered for service status data'
[1493675411] ndomod registered for adaptive program data'
[1493675411] ndomod registered for adaptive host data'
[1493675411] ndomod registered for adaptive service data'
[1493675411] ndomod registered for external command data'
[1493675411] ndomod registered for aggregated status data'
[1493675411] ndomod registered for retention data'
[1493675411] ndomod registered for contact data'
[1493675411] ndomod registered for contact notification data'
[1493675411] ndomod registered for acknowledgement data'
[1493675411] ndomod registered for state change data'
[1493675411] ndomod registered for contact status data'
[1493675411] ndomod registered for adaptive contact data'
[1493675411] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1493675411] Successfully launched command file worker with pid 2548

Re: nagios.lock does not exist or is a zombie

Posted: Mon May 01, 2017 5:06 pm
by raulv
After I restore the backup the Nagios status and the journal output are the following:

Code: Select all

[root@nagios tmp]# systemctl status nagios.service
● nagios.service - LSB: Starts and stops the Nagios monitoring server
   Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
   Active: failed (Result: resources) since Mon 2017-05-01 17:03:20 CDT; 34s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7114 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)
 Main PID: 2502 (code=exited, status=0/SUCCESS)

May 01 17:03:18 nagios nagios[7136]: wproc: Registry request: name=Core Worker 7141;pid=7141
May 01 17:03:18 nagios nagios[7136]: wproc: Registry request: name=Core Worker 7142;pid=7142
May 01 17:03:18 nagios nagios[7136]: Error: Could not load module '/usr/local/lib/mk-livestatus/livestatus.o' -...ectory
May 01 17:03:18 nagios nagios[7136]: Error: Failed to load module '/usr/local/lib/mk-livestatus/livestatus.o'.
May 01 17:03:18 nagios nagios[7114]: Starting nagios: done.
May 01 17:03:18 nagios systemd[1]: PID 7136 read from file /usr/local/nagios/var/nagios.lock does not exist or ...ombie.
May 01 17:03:20 nagios systemd[1]: nagios.service never wrote its PID file. Failing.
May 01 17:03:20 nagios systemd[1]: Failed to start LSB: Starts and stops the Nagios monitoring server.
May 01 17:03:20 nagios systemd[1]: Unit nagios.service entered failed state.
May 01 17:03:20 nagios systemd[1]: nagios.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

[root@nagios tmp]# journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-147.scope has finished starting up.
--
-- The start-up result is done.
May 01 17:04:01 nagios systemd[1]: Starting Session 147 of user nagios.
-- Subject: Unit session-147.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-147.scope has begun starting up.
May 01 17:04:01 nagios CROND[7288]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1)
May 01 17:04:01 nagios systemd[1]: Started Session 142 of user nagios.
-- Subject: Unit session-142.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-142.scope has finished starting up.
--
-- The start-up result is done.
May 01 17:04:01 nagios systemd[1]: Starting Session 142 of user nagios.
-- Subject: Unit session-142.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-142.scope has begun starting up.
May 01 17:04:01 nagios CROND[7289]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1)
May 01 17:04:01 nagios systemd[1]: Started Session 141 of user nagios.
-- Subject: Unit session-141.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-141.scope has finished starting up.
--
-- The start-up result is done.
May 01 17:04:01 nagios systemd[1]: Starting Session 141 of user nagios.
-- Subject: Unit session-141.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-141.scope has begun starting up.
May 01 17:04:01 nagios CROND[7290]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1)
May 01 17:04:01 nagios CROND[7291]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1)
May 01 17:04:01 nagios CROND[7292]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1)
May 01 17:04:01 nagios CROND[7294]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1)
May 01 17:04:01 nagios CROND[7295]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1)
May 01 17:04:01 nagios CROND[7297]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.log 2>&1)
May 01 17:04:01 nagios CROND[7298]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php > /usr/local/nagiosxi/var/event_handler.log 2>&1)
~
~
~

Re: nagios.lock does not exist or is a zombie

Posted: Tue May 02, 2017 9:56 am
by dwhitfield
In your nagios.cfg (which you can find in the CCM), comment out the livestatus module and see if that gets things going. I know we have XI users using livestatus, but

Code: Select all

May 01 17:03:18 nagios nagios[7136]: Error: Could not load module '/usr/local/lib/mk-livestatus/livestatus.o' -...ectory
May 01 17:03:18 nagios nagios[7136]: Error: Failed to load module '/usr/local/lib/mk-livestatus/livestatus.o'.
If that ends up resolving your issue, you can either leave livestatus out, or you may need to speak with the developers of livestatus.

Re: nagios.lock does not exist or is a zombie

Posted: Tue May 02, 2017 4:28 pm
by raulv
Thanks, the problem is solved

Re: nagios.lock does not exist or is a zombie

Posted: Tue May 02, 2017 4:33 pm
by dwhitfield
As it sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!

Re: nagios.lock does not exist or is a zombie

Posted: Tue May 02, 2017 5:18 pm
by raulv
Yes you can lock this thread, thaks