Re: Fixing damaged and/or partial installs of Nagios
Posted: Fri Sep 05, 2014 11:19 am
This is VERY confusing. It looks to me like all the commands are getting defined in /etc/nagios3/conf.d/commands.cfg. Beyond the code that I've added to that file for check_disk, do I also need to add the
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
to /etc/nagios/nrpe.cfg? That's the only instance of nrpe.cfg that I find on my Nagios server. When ever someone speaks of making changes to files, it's often not clear which side the changes need to be made on: server or monitored node.
I just realized that this (from /etc/nagios3/conf.d/services.cfg) might be part of the problem, though:
define service {
use default-service
hostgroup_name portal
service_description Disk Space
check_command check_nrpe!check_disk
}
I'm thinking that maybe I didn't make all of the changes that eloyd recommended in his posting. So, I've just made the following additions:
# To /etc/nagios3/conf.d/commands.cfg...
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a "$ARG2$"
}
#To /etc/nagios3/conf.d/services.cfg...
define service {
use nrpe-service
hostgroup_name portal
service_description Disk Space
check_command check_nrpe!check_disk!-w 20% -c 10% -p /
}
# To /etc/nagios/nrpe.cfg...
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
On the Nagios server, I ran:
# service nagios3 restart; service nagios-nrpe-server restart
and on the monitored node (since it's running Amazon Linux), I ran:
# service nagios restart
The error displayed on the "Service Status" screen changed, somewhat (see attached). At least the command is now being recognized as having been defined. The last lines in /var/log/messages on the monitored node show:
Sep 5 16:50:34 ip-10-160-23-32 nrpe[11195]: Error: Request contained command arguments, but argument option is not enabled!
Sep 5 16:50:34 ip-10-160-23-32 nrpe[11195]: Client request was invalid, bailing out...
So, it looks like there's something wrong with the way I formatted one of those lines that I added. I'm gonna Google the error...
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
to /etc/nagios/nrpe.cfg? That's the only instance of nrpe.cfg that I find on my Nagios server. When ever someone speaks of making changes to files, it's often not clear which side the changes need to be made on: server or monitored node.
I just realized that this (from /etc/nagios3/conf.d/services.cfg) might be part of the problem, though:
define service {
use default-service
hostgroup_name portal
service_description Disk Space
check_command check_nrpe!check_disk
}
I'm thinking that maybe I didn't make all of the changes that eloyd recommended in his posting. So, I've just made the following additions:
# To /etc/nagios3/conf.d/commands.cfg...
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a "$ARG2$"
}
#To /etc/nagios3/conf.d/services.cfg...
define service {
use nrpe-service
hostgroup_name portal
service_description Disk Space
check_command check_nrpe!check_disk!-w 20% -c 10% -p /
}
# To /etc/nagios/nrpe.cfg...
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
On the Nagios server, I ran:
# service nagios3 restart; service nagios-nrpe-server restart
and on the monitored node (since it's running Amazon Linux), I ran:
# service nagios restart
The error displayed on the "Service Status" screen changed, somewhat (see attached). At least the command is now being recognized as having been defined. The last lines in /var/log/messages on the monitored node show:
Sep 5 16:50:34 ip-10-160-23-32 nrpe[11195]: Error: Request contained command arguments, but argument option is not enabled!
Sep 5 16:50:34 ip-10-160-23-32 nrpe[11195]: Client request was invalid, bailing out...
So, it looks like there's something wrong with the way I formatted one of those lines that I added. I'm gonna Google the error...