CentOS - Unable to monitor Redhat OS

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CentOS - Unable to monitor Redhat OS

Post by Box293 »

Thanks for that.

So now what output do you get when you run this at the command line of your Nagios XI host:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.168.12 -c check_disk -a '-w 20% -c 10% -p /'
Also, on your remote host, ssh to it and run these commands and show us the output:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timlee
Posts: 60
Joined: Mon Jan 12, 2015 10:01 pm

Re: CentOS - Unable to monitor Redhat OS

Post by timlee »

Box293 wrote:Thanks for that.

So now what output do you get when you run this at the command line of your Nagios XI host:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.168.12 -c check_disk -a '-w 20% -c 10% -p /'
Also, on your remote host, ssh to it and run these commands and show us the output:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
Thanks for following up.

From Nagios XI:

Code: Select all

[root@NagiosCentOS6 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.168.123 -c check_disk -a '-w 20% -c 10% -p /'
CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.
From remote host:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
DISK OK - free space: / 4754 MB (67% inode=84%);| /=2330MB;5976;6723;0;7470
Remote host log:

Code: Select all

[root@localhost ~]# tail /var/log/messages
Feb 12 01:25:48 localhost nrpe[10999]: Client request was invalid, bailing out...
Feb 12 01:25:48 localhost xinetd[25224]: EXIT: nrpe status=0 pid=10999 duration=0(sec)
Feb 12 01:26:10 localhost xinetd[25224]: START: nrpe pid=11128 from=::ffff:192.168.168.124
Feb 12 01:26:10 localhost nrpe[11128]: Error: Request contained command arguments, but argument option is not enabled!
Feb 12 01:26:10 localhost nrpe[11128]: Client request was invalid, bailing out...
Feb 12 01:26:10 localhost xinetd[25224]: EXIT: nrpe status=0 pid=11128 duration=0(sec)
Feb 12 01:26:11 localhost xinetd[25224]: START: nrpe pid=11129 from=::ffff:192.168.168.127
Feb 12 01:26:11 localhost nrpe[11129]: Error: Request contained command arguments, but argument option is not enabled!
Feb 12 01:26:11 localhost nrpe[11129]: Client request was invalid, bailing out...
Feb 12 01:26:11 localhost xinetd[25224]: EXIT: nrpe status=0 pid=11129 duration=0(sec)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CentOS - Unable to monitor Redhat OS

Post by Box293 »

On the remote host, I'm pretty sure these steps haven't been done:

Edit /usr/local/nagios/etc/nrpe.cfg
Change:

Code: Select all

dont_blame_nrpe=0
To:

Code: Select all

dont_blame_nrpe=1

Code: Select all

service xinetd restart
Also, your remote host test shows the test being executed as root, please make sure you do the test like this:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timlee
Posts: 60
Joined: Mon Jan 12, 2015 10:01 pm

Re: CentOS - Unable to monitor Redhat OS

Post by timlee »

Box293 wrote:On the remote host, I'm pretty sure these steps haven't been done:

Edit /usr/local/nagios/etc/nrpe.cfg
Change:

Code: Select all

dont_blame_nrpe=0
To:

Code: Select all

dont_blame_nrpe=1

Code: Select all

service xinetd restart
Also, your remote host test shows the test being executed as root, please make sure you do the test like this:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
running the check_disk command as nagios user works. I have verified that the remote host dont_blame is set to 1.

Now i'm getting another type of error on most of the services (except load,ping,users) - e.g.(NRPE: Command 'check_disk' not defined)
Please help.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CentOS - Unable to monitor Redhat OS

Post by Box293 »

On the remote machine, in the file:
/usr/local/nagios/etc/nrpe.cfg

Can you confirm if this exists:
include_dir=/usr/local/nagios/etc/nrpe

If it does, does check_disk exist inside of /usr/local/nagios/etc/nrpe/common.cfg ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timlee
Posts: 60
Joined: Mon Jan 12, 2015 10:01 pm

Re: CentOS - Unable to monitor Redhat OS

Post by timlee »

Box293 wrote:On the remote machine, in the file:
/usr/local/nagios/etc/nrpe.cfg

Can you confirm if this exists:
include_dir=/usr/local/nagios/etc/nrpe

If it does, does check_disk exist inside of /usr/local/nagios/etc/nrpe/common.cfg ?
Hi, it shows this:

Code: Select all

# INCLUDE CONFIG FILE
# This directive allows you to include definitions from an external config file.

#include=<somefile.cfg>



# INCLUDE CONFIG DIRECTORY
# This directive allows you to include definitions from config files (with a
# .cfg extension) in one or more directories (with recursion).

#include_dir=<somedirectory>
#include_dir=<someotherdirectory>
I changed the directory to this:

Code: Select all

# INCLUDE CONFIG DIRECTORY
# This directive allows you to include definitions from config files (with a
# .cfg extension) in one or more directories (with recursion).

#include_dir=/usr/local/nagios/etc/nrpe
Under /usr/local/nagios/etc/nrpe/common.cfg, I suppose it exist.

Code: Select all

### DISK ###
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
command[check_ide_smart]=/usr/local/nagios/libexec/check_ide_smart $ARG1$
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CentOS - Unable to monitor Redhat OS

Post by Box293 »

Almost there.

Change This:

Code: Select all

#include_dir=/usr/local/nagios/etc/nrpe
To This:

Code: Select all

include_dir=/usr/local/nagios/etc/nrpe

Code: Select all

service xinetd restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timlee
Posts: 60
Joined: Mon Jan 12, 2015 10:01 pm

Re: CentOS - Unable to monitor Redhat OS

Post by timlee »

Box293 wrote:Almost there.

Change This:

Code: Select all

#include_dir=/usr/local/nagios/etc/nrpe
To This:

Code: Select all

include_dir=/usr/local/nagios/etc/nrpe

Code: Select all

service xinetd restart
Thanks heaps! It works! I think we are almost done, just a couple of checks left...

1) Sendmail with error *** sendmail: Nok ***
2) System Logging Daemon NRPE: Unable to read output
3) Yum Updates YUM WARNING: O/S requires an update (Which I think i can ignore at this point of time)

Please advise. :D
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CentOS - Unable to monitor Redhat OS

Post by Box293 »

timlee wrote:Thanks heaps! It works! I think we are almost done, just a couple of checks left...
Excellent!
timlee wrote:1) Sendmail with error *** sendmail: Nok ***
2) System Logging Daemon NRPE: Unable to read output
3) Yum Updates YUM WARNING: O/S requires an update (Which I think i can ignore at this point of time)
1 & 2
Configure - > Core Configuration Mananger
Monitoring -> Services
Find one of the services that is not currently working
Click the Disk icon for it
Paste the contents of the output from the disk icon here in a code block.

3
Do a yum update on the remote host to install the updates.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timlee
Posts: 60
Joined: Mon Jan 12, 2015 10:01 pm

Re: CentOS - Unable to monitor Redhat OS

Post by timlee »

1 & 2
Configure - > Core Configuration Mananger
Monitoring -> Services
Find one of the services that is not currently working
Click the Disk icon for it
Paste the contents of the output from the disk icon here in a code block.

3
Do a yum update on the remote host to install the updates.
For Sendmail:

Code: Select all

define service {
	host_name			192.168.168.123
	service_description		Sendmail
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_services!-a 'sendmail'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			linux-server
	register			1
	}
For Syslog:

Code: Select all

define service {
	host_name			192.168.168.123
	service_description		System Logging Daemon
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_init_service!-a 'syslog'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			linux-server
	register			1
	}
Locked