Page 2 of 3
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 9:37 am
by scottwilkerson
Can you show the check_nrpe command definition on the nagios server?
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 9:39 am
by gmills
# 'check_dir_files' command definition
define command{
command_name check_dir_files
command_line $USER1$/check_dir_files -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 9:43 am
by scottwilkerson
This is the definition for check_dir_files
I wanted to see check_nrpe
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 9:46 am
by gmills
sorry Scott
###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 9:50 am
by scottwilkerson
Change this to
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}
then restart nagios
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 10:04 am
by gmills
command[check_dir_files]=/usr/local/nagios/libexec/check_dir_files.sh -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
I hope this is what you are looking for
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 10:09 am
by scottwilkerson
Did you see this? You need to add $ARG2$
scottwilkerson wrote:Change this to
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}
then restart nagios
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 1:28 pm
by gmills
Scott
I just couldn't get the passing of parameters to the NRPE server working. from the logs on the nagios and nrpe servers I can see that parms are being passed, I just couldn't get it working. So, I simply took an alternative work around, please let me know if this is ok. I just created static commands and services for the calling methods. it is working just not the way of passing parameters from the nagios server.
my new config for this plugin check_dir_
NAGIOS SERVER
command.cfg
# 'check_dir_files_CoP_Alaska' command definition
define command{
command_name check_dir_files_CoP_Alaska
command_line $USER1$/check_dir_files
}
# 'check_dir_files_BPCRP' command definition
define command{
command_name check_dir_files_BPCRP
command_line $USER1$/check_dir_files
}
# 'check_dir_files_GCMS' command definition
define command{
command_name check_dir_files_GCMS
command_line $USER1$/check_dir_files
}
# 'check_dir_files_MaerskDrilling' command definition
define command{
command_name check_dir_files_MaerskDrilling
command_line $USER1$/check_dir_files
}
# 'check_dir_files_MSCommand' command definition
define command{
command_name check_dir_files_MSCommand
command_line $USER1$/check_dir_files
}
# 'check_dir_files_Noble' command definition
define command{
command_name check_dir_files_Noble
command_line $USER1$/check_dir_files
}
services.cfg
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count CoP_Alaska
check_command check_nrpe!check_dir_files_CoP_Alaska
notifications_enabled 0
}
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count BP Cooper
check_command check_nrpe!check_dir_files_BPCRP
notifications_enabled 0
}
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count MaerskDrilling
check_command check_nrpe!check_dir_files_MaerskDrilling
notifications_enabled 0
}
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count GCMS
check_command check_nrpe!check_dir_files_GCMS
notifications_enabled 0
}
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count MSCommand
check_command check_nrpe!check_dir_files_MSCommand
notifications_enabled 0
}
define service{
use generic-service ; Name of service template to use
host_name alphprdfuse1i
service_description Inbound Dir Count Noble
check_command check_nrpe!check_dir_files_Noble
notifications_enabled 0
}
ON NRPE SERVER
command[check_dir_files_CoP_Alaska]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/CoP_Alaska -w 10 -c 100 -f
command[check_dir_files_BPCRP]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/BPCRP -w 10 -c 100 -f
command[check_dir_files_GCMS]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/GCMS -w 10 -c 100 -f
command[check_dir_files_MaerskDrilling]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/MaerskDrilling -w 10 -c 100 -f
command[check_dir_files_MSCommand]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/MSCommand -w 10 -c 100 -f
command[check_dir_files_Noble]=/usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/Noble -w 10 -c 100 -f
LOG of NRPE SERVER
Host 3.239.245.209 is asking for command 'check_dir_files_MaerskDrilling' to be run...
[1560796045] Running command: /usr/local/nagios/libexec/check_dir_files.sh -d /GlobalScapeSftpRepo/MaerskDrilling -w 10 -c 100 -f
[1560796045] Command completed with return code 0 and output: OK - There are 0 files in dir /GlobalScapeSftpRepo/MaerskDrilling|'size'=0;10;100
[1560796045] Return Code: 0, Output: OK - There are 0 files in dir /GlobalScapeSftpRepo/MaerskDrilling|'size'=0;10;100
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 1:47 pm
by scottwilkerson
This should be fine.
Re: check_dir_files plugin can't get to work on remote nrpe
Posted: Mon Jun 17, 2019 1:49 pm
by gmills
thank you Scott, I deeply appreciate your help