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?
No lock file found in /var/run/nagios.lock
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: No lock file found in /var/run/nagios.lock
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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: No lock file found in /var/run/nagios.lock
[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:
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:
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: No lock file found in /var/run/nagios.lock
@smapple, Run these commands if you are on CentOS/RHEL 6.X:
Run these commands if you are on CentOS/RHEL 7.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
And if this doesn't resolve the issue please send in your system profile.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
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: No lock file found in /var/run/nagios.lock
[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
nagios (pid 3581) is running...
[sadmin@nagiosxi run]$
Nagios is running now..HOwever i am unable to load nagiosxi on the browser
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: No lock file found in /var/run/nagios.lock
@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
Please upload /var/log/httpd/error_log or if you're using ssl /var/log/httpd/ssl_error_log
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: No lock file found in /var/run/nagios.lock
(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
(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
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: No lock file found in /var/run/nagios.lock
@smapple, Do you have some other application that is already listening on the port 80? Can you show me the output of this command:
Then kill all httpd processes and start it again:sudo netstat -tulpn| grep :80
killall -9 httpd
service httpd start
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: No lock file found in /var/run/nagios.lock
Thank you! The issue is resolved!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: No lock file found in /var/run/nagios.lock
Great! Locking threadsmapple wrote:Thank you! The issue is resolved!