Cannot write to pidfile
Cannot write to pidfile
I've been battling with setting up Nagios on my RHEL 7 environment for some time now but no luck. My current issue is, when i restart NRPE, in # journalctl -n i get Cannot write to pidfile /var/run/nrpe/nrpe.pid - check your privileges
when i run # grep pid /etc/nagios/nrpe.cfg
output is pid_file=/var/run/nrpe/nrpe.pid
I proceed to see what in that directory but there is no nrpe in /var/run, which means nrpe is not created in /var/run.
Find -name nrpe.pid returns nothing.
ls -la /etc/xinetd.d/nrpe returns
-rw-r--r-- 1 root root 429 Jul 25 14:50 /etc/xinetd.d/nrpe
to check what type of nrpe i configured
All helps are definitely welcomed.
when i run # grep pid /etc/nagios/nrpe.cfg
output is pid_file=/var/run/nrpe/nrpe.pid
I proceed to see what in that directory but there is no nrpe in /var/run, which means nrpe is not created in /var/run.
Find -name nrpe.pid returns nothing.
ls -la /etc/xinetd.d/nrpe returns
-rw-r--r-- 1 root root 429 Jul 25 14:50 /etc/xinetd.d/nrpe
to check what type of nrpe i configured
All helps are definitely welcomed.
-
bolson
Re: Cannot write to pidfile
Hello sirampadu,
How did you install NRPE? It would appear to be xinetd... How are you restarting nrpe?
How did you install NRPE? It would appear to be xinetd... How are you restarting nrpe?
Re: Cannot write to pidfile
systemctl restart nrpe
Re: Cannot write to pidfile
Please answer all of our questions so we can better assist you:
bolson wrote:How did you install NRPE? It would appear to be xinetd...
Former Nagios employee
Re: Cannot write to pidfile
I downloaded the nrpe-3.2.0. tar.gz , then i extracted it with tar -xzf. Proceeded nrpe-3.2.0 then ran the installation from there. I'm restarting nrpe with "
systemctl restart nrpe"
Yes it is with xinetd
systemctl restart nrpe"
Yes it is with xinetd
-
bolson
Re: Cannot write to pidfile
the proper way to start/restart your version of nrpe is by starting or restarting the xinetd service. Ie: systemctl start xinetd
Let me know if this resolves your issue.
Let me know if this resolves your issue.
Re: Cannot write to pidfile
Status on Xinetd is active. Should status on nrpe be active or inactive since Xinetd is running?
i ran this command to see if there is communication between client and host
#/usr/local/nagios//libexec/check_nrpe -H hostname -t 30 -c check_users -a '-w 5 -c 10'
is that a correct command to use since I'm using xinetd?
i ran this command to see if there is communication between client and host
#/usr/local/nagios//libexec/check_nrpe -H hostname -t 30 -c check_users -a '-w 5 -c 10'
is that a correct command to use since I'm using xinetd?
-
bolson
Re: Cannot write to pidfile
You can run the following command to confirm that nrpe is running:
If it's running, execute the following from the cli on your Nagios Core server:
Let me know if you have additional questions.
Code: Select all
telnet localhost 5666Code: Select all
/usr/local/nagios/libexec/check_nrpe -H ip_addr_of_host_to_monitor -c check_mem '-a -w 20 -c 10'Re: Cannot write to pidfile
telnet localhost 5666
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
/usr/local/nagios/libexec/check_nrpe -H host_name -c check_mem '-a -w 20 -c 10'
CHECK_NRPE: Error - Could not connect to host_name: Connection reset by peer
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
/usr/local/nagios/libexec/check_nrpe -H host_name -c check_mem '-a -w 20 -c 10'
CHECK_NRPE: Error - Could not connect to host_name: Connection reset by peer
Last edited by sirampadu on Tue Jul 25, 2017 11:46 am, edited 1 time in total.
-
bolson
Re: Cannot write to pidfile
NRPE is not running. Please copy and paste the contents of /etc/xinetd.d/nrpe
Thank you.
Thank you.