nrpe error with yum service check only in my host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dimsum
Posts: 153
Joined: Thu Aug 15, 2013 6:05 pm

nrpe error with yum service check only in my host

Post by dimsum »

Hi,

I run check nrpe on centos every service is ok. but I got a yum service was return "CHECK_NRPE: Socket timeout after 30 seconds."

On another server with the same service check is fine. I have no idea on this issue.

Please advice.

Thank you.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: nrpe error with yum service check only in my host

Post by cdienger »

What is the exact command that the check is running? What is returned if you run "/usr/local/nagios/libexec/check_services -p <service_name>" on the remote system?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dimsum
Posts: 153
Joined: Thu Aug 15, 2013 6:05 pm

Re: nrpe error with yum service check only in my host

Post by dimsum »

Hi,

Please find the picture that I run nrpe command check.

Thank you.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: nrpe error with yum service check only in my host

Post by npolovenko »

@dimsum, What happens when you manually run the nrpe command from the nagios server?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H remote_server_ip -t 30  -c check_yum
Actually, I think I know what the problem is. The check_yum command is not defined in /usr/local/nagios/etc/nrpe.cfg on the remote server. Open that file and scroll all the way down till you see the command definitions:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
Add a new one underneath:

Code: Select all

command[check_yum]=/usr/local/nagios/libexec/check_services -p yum
Exit out of the file and restart the nrpe with the appropriate command:

Code: Select all

service nrpe restart
or

Code: Select all

service xinetd restart
Depending on your installation.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dimsum
Posts: 153
Joined: Thu Aug 15, 2013 6:05 pm

Re: nrpe error with yum service check only in my host

Post by dimsum »

I try to add the command line into nrpe.conf then restart service I found the return is 7 what is mean?

Thank you.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: nrpe error with yum service check only in my host

Post by npolovenko »

@dimsum, I believe it shows a number of processes currently running that contain the word "yum". Looks like its working.

Code: Select all

      amt=$(ps aax | egrep "$patern" | grep -v egrep | grep -v "$PROGNAME" | wc -l | sed 's| ||g')
                str="$patern: $amt"
                if [ $amt -lt 1 ]; then
                        str="*** $patern: Nok ***"
                        exitstatus=$STATE_CRITICAL
                fi
                res="$res  $str"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked