Page 1 of 1
No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 2:52 pm
by smapple
Hello Team,
I am unable to start or stop the nagios services. I get the below error messages.
[sadmin@nagiosxi ~]$ service nagios stop
Stopping nagios: No lock file found in /var/run/nagios.lock
[sadmin@nagiosxi ~]$
Can you please let me know how do I resolve this?
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 2:55 pm
by npolovenko
Hello,
@smapple. What version of XI are you on? Please run the following commands and show me the output:
cat /etc/rc.d/init.d/nagios | grep NagiosRunFile=
cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint.sh | grep lockfile=
cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint_specific.sh | grep lockfile=
cat /usr/local/nagios/etc/nagios.cfg | grep lock
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:04 pm
by smapple
[sadmin@nagiosxi run]$ cat /etc/rc.d/init.d/nagios | grep NagiosRunFile=
NagiosRunFile=/var/run/nagios.lock
[sadmin@nagiosxi run]$ cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint.sh | grep lockfile=
cat: /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint.sh: Permission denied
[sadmin@nagiosxi run]$ sudo cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint.sh | grep lockfile=
[sudo] password for sadmin:
[sadmin@nagiosxi run]$ cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint_specific.sh | grep lockfile=
cat: /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint_specific.sh: Permission denied
[sadmin@nagiosxi run]$ sudo cat /usr/local/nagiosxi/scripts/nom_restore_nagioscore_checkpoint_specific.sh | grep lockfile=
[sadmin@nagiosxi run]$ sudo cat /usr/local/nagios/etc/nagios.cfg | grep lock
lock_file=/var/run/nagios.lock
[sadmin@nagiosxi run]$
Please find the results above:
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:12 pm
by npolovenko
@smapple, Run these commands if you are on CentOS/RHEL 6.X:
service crond stop
service npcd stop
service nagios stop
service ndo2db stop
pkill -9 -u nagios
for i in $(ipcs -q | grep nagios |awk '{print $2}'); do ipcrm -q $i; done
rm -rf /usr/local/nagiosxi/var/dbmaint.lock
rm -rf /usr/local/nagiosxi/var/event_handler.lock
rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
service mysqld restart
service ndo2db start
service nagios start
service npcd start
service crond start
Run these commands if you are on CentOS/RHEL 7.X:
systemctl stop crond
systemctl stop npcd
systemctl stop nagios
systemctl stop ndo2db
pkill -9 -u nagios
for i in $(ipcs -q | grep nagios |awk '{print $2}'); do ipcrm -q $i; done
rm -rf /usr/local/nagiosxi/var/dbmaint.lock
rm -rf /usr/local/nagiosxi/var/event_handler.lock
rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
systemctl restart mariadb
systemctl start ndo2db
systemctl start nagios
systemctl start npcd
systemctl start crond
And if this doesn't resolve the issue please send in your system profile.
To send us your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and send it to me in a personal message.
After you send me the profile please post something in this thread to bring it back up in the support queue.
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:19 pm
by smapple
[sadmin@nagiosxi run]$ sudo service nagios status
nagios (pid 3581) is running...
[sadmin@nagiosxi run]$
Nagios is running now..HOwever i am unable to load nagiosxi on the browser
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:20 pm
by npolovenko
@smapple , Is httpd running?
service httpd status
Please upload /var/log/httpd/error_log or if you're using ssl /var/log/httpd/ssl_error_log
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:26 pm
by smapple
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Http error
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:34 pm
by npolovenko
@smapple, Do you have some other application that is already listening on the port 80? Can you show me the output of this command:
sudo netstat -tulpn| grep :80
Then kill all httpd processes and start it again:
killall -9 httpd
service httpd start
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:43 pm
by smapple
Thank you! The issue is resolved!
Re: No lock file found in /var/run/nagios.lock
Posted: Fri Dec 14, 2018 3:48 pm
by scottwilkerson
smapple wrote:Thank you! The issue is resolved!
Great! Locking thread