errors on cron and ssh checks after centos update

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

errors on cron and ssh checks after centos update

Post by amunter »

I just updated a CentOS host today that I monitor with Nagios XI. Lots of yum updates were pending. It's now running CentOS Linux release 7.6.1810 (Core). It is also happening on a Redhat 7 machine that was also updated today. Same issues.

After the update I started getting Nagios warnings on checks for cron and ssh. Each hour I get a warning email "NRPE: Unable to read output". I also get an error for Jenkins CI service monitoring. It is working fine on other RHEL 7 hosts.

I hadn't updated the Nagios XI server, but I'm doing that now.

Any ideas what would have caused the issue with just those monitored services on those two and where else I can look for more error text?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: errors on cron and ssh checks after centos update

Post by npolovenko »

@amunter, Can you run the following commands on the nrpe server and show me the output?
sudo /usr/local/nagios/libexec/check_init_service sshd
sudo /usr/local/nagios/libexec/check_init_service crond
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: errors on cron and ssh checks after centos update

Post by amunter »

Code: Select all

$ sudo /usr/local/nagios/libexec/check_init_service sshd
active
$ sudo /usr/local/nagios/libexec/check_init_service crond
active
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: errors on cron and ssh checks after centos update

Post by npolovenko »

@amunter, Interesting. Appears that both services are actually running. Can you run these commands from the nagios server and show me the output?
/usr/local/nagios/libexec/check_nrpe -H nrpe_ip_address -t 30 -c check_init_service -a 'crond'
/usr/local/nagios/libexec/check_nrpe -H nrpe_ip_address -t 30 -c check_init_service -a 'sshd'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: errors on cron and ssh checks after centos update

Post by amunter »

Code: Select all

[root@nagiosxi ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.102 -t 30 -c check_init_service -a 'crond'
NRPE: Unable to read output
[root@nagiosxi ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.102 -t 30 -c check_init_service -a 'sshd'
NRPE: Unable to read output
Other checks run ok:

Code: Select all

[root@nagiosxi ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.102 -t 30
NRPE v3.2.1
[root@nagiosxi ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.102 -t 30 -c check_procs -a '-w 150 -c 250'
PROCS OK: 121 processes | procs=121;150;250;0;
but the check_init_service ones fail remotely even though they succeed locally.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: errors on cron and ssh checks after centos update

Post by npolovenko »

@amunter, Can you show me how the check_init service is defined in the nrpe.cfg file on the nrpe server?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: errors on cron and ssh checks after centos update

Post by amunter »

Here it is with all of the comments and whitespace lines removed. I notice that it doesn't have my nagios server listed in allowed hosts, but the other checks still complete, and I did give it the IP address of my nagios server when running the "fullinstall" script recently on the installer. That IP is in the /etc/xinetd.d/nrpe file as an "only_from" variable.

When these warnings started I updated my NagiosXI install, then got the linux-nrpe-client tarball from it and reinstalled nrpe, specifying the nagios server's IP at the end of the install process.

Code: Select all

#  cat /usr/local/nagios/etc/nrpe.cfg | grep -v "#" | uniq

log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1
dont_blame_nrpe=1
debug=0
command_timeout=60
connection_timeout=300
include_dir=/usr/local/nagios/etc/nrpe
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: errors on cron and ssh checks after centos update

Post by npolovenko »

@amunter, If nrpe was installed under the xinetd it's normal that allowed hosts would not be in the nrpe.cfg, but in the /etc/xinetd.d/nrpe. Can you upload all the files that you have in this folder?
/usr/local/nagios/etc/nrpe
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: errors on cron and ssh checks after centos update

Post by amunter »

Sure, here ya go. Two files are in the directory: asterisk.cfg and common.cfg.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: errors on cron and ssh checks after centos update

Post by ssax »

I would recompile NRPE OR re-install the linux NRPE agent, some packages probably got updated from what NRPE binary was compiled with and is not working properly now. A recompile/re-install should likely pick them up, it depends on how you installed the agent though.

https://assets.nagios.com/downloads/nag ... _Agent.pdf
Locked