check_dir_files plugin can't get to work on remote nrpe serv
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_dir_files plugin can't get to work on remote nrpe
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
# '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
}
define command{
command_name check_dir_files
command_line $USER1$/check_dir_files -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_dir_files plugin can't get to work on remote nrpe
This is the definition for check_dir_files
I wanted to see check_nrpe
I wanted to see check_nrpe
Re: check_dir_files plugin can't get to work on remote nrpe
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$
}
###############################################################################
# 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$
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_dir_files plugin can't get to work on remote nrpe
Change this to
then restart nagios
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}
Re: check_dir_files plugin can't get to work on remote nrpe
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
I hope this is what you are looking for
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_dir_files plugin can't get to work on remote nrpe
Did you see this? You need to add $ARG2$
scottwilkerson wrote:Change this tothen restart nagiosCode: Select all
define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ }
Re: check_dir_files plugin can't get to work on remote nrpe
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_dir_files plugin can't get to work on remote nrpe
This should be fine.
Re: check_dir_files plugin can't get to work on remote nrpe
thank you Scott, I deeply appreciate your help