check_dir_files plugin can't get to work on remote nrpe serv
Posted: Fri Jun 14, 2019 1:28 pm
Hello, I need help, of course I'm still new to nagios, but, I've had tremendous success so far, thank you nagios and community
I am trying to get the plugin check_dir_files.sh to work on remote NRPE server. It works on localhost, the nagios server node.
it works manually by executing the command on both my servers, it works on nagios local system, I can't get it to work on remote server.
./check_dir_files.sh
Usage: check_dir_files.sh -d|--dirname [-w|--warning ] [-c|--critical ] [-f|--perfdata]
Usage: check_dir_files.sh -h|--help
Usage: check_dir_files.sh -V|--version
on nagios monitor server
commands.cfg
# 'check_local_dir_files' command definition
define command{
command_name check_local_dir_files
command_line $USER1$/check_dir_files.sh -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
# 'check_dir_files' command definition
define command{
command_name check_dir_files
command_line $USER1$/check_dir_files.sh -H $HOSTADDRESS$ -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
localhost.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - Noble
check_command check_local_dir_files!/GlobalScapeSftpRepo/Noble!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MSCommand
check_command check_local_dir_files!/GlobalScapeSftpRepo/MSCommand!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MaerskDrilling
check_command check_local_dir_files!/GlobalScapeSftpRepo/MaerskDrilling!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - GCMS
check_command check_local_dir_files!/GlobalScapeSftpRepo/GCMS!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - BPCRP
check_command check_local_dir_files!/GlobalScapeSftpRepo/BPCRP!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - CoP_Alaska
check_command check_local_dir_files!/GlobalScapeSftpRepo/CoP_Alaska!10!100!
notifications_enabled 0
}
services.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - Noble
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/Noble!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MSCommand
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/MSCommand!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MaerskDrilling
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/MaerskDrilling!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - GCMS
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/GCMS!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - BPCRP
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/BPCRP!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - CoP_Alaska
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/CoP_Alaska!10!100!
notifications_enabled 0
}
On NRPE server
nrpe.cfg
command[check_dir_files]=/usr/local/nagios/libexec/check_dir_files.sh -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
it works manually on both machines manually
./check_dir_files.sh -d /GlobalScapeSftpRepo/Noble/ -w 10 -c 100 -f
OK - There are 1 files in dir /GlobalScapeSftpRepo/Noble/|'size'=1;10;100
hoping others have set this plugin up or knowledge is deeper than mine(newbie) thank you
I know it is something how the args are defined in statement because of below, execute on nagios server to nrpe server
./check_nrpe -H 3.36.24.89
NRPE v3.2.1
./check_nrpe -H 3.36.24.89 -c check_dir_files
OK - There are 0 files in dir -w
I am trying to get the plugin check_dir_files.sh to work on remote NRPE server. It works on localhost, the nagios server node.
it works manually by executing the command on both my servers, it works on nagios local system, I can't get it to work on remote server.
./check_dir_files.sh
Usage: check_dir_files.sh -d|--dirname [-w|--warning ] [-c|--critical ] [-f|--perfdata]
Usage: check_dir_files.sh -h|--help
Usage: check_dir_files.sh -V|--version
on nagios monitor server
commands.cfg
# 'check_local_dir_files' command definition
define command{
command_name check_local_dir_files
command_line $USER1$/check_dir_files.sh -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
# 'check_dir_files' command definition
define command{
command_name check_dir_files
command_line $USER1$/check_dir_files.sh -H $HOSTADDRESS$ -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
}
localhost.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - Noble
check_command check_local_dir_files!/GlobalScapeSftpRepo/Noble!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MSCommand
check_command check_local_dir_files!/GlobalScapeSftpRepo/MSCommand!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MaerskDrilling
check_command check_local_dir_files!/GlobalScapeSftpRepo/MaerskDrilling!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - GCMS
check_command check_local_dir_files!/GlobalScapeSftpRepo/GCMS!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - BPCRP
check_command check_local_dir_files!/GlobalScapeSftpRepo/BPCRP!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - CoP_Alaska
check_command check_local_dir_files!/GlobalScapeSftpRepo/CoP_Alaska!10!100!
notifications_enabled 0
}
services.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - Noble
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/Noble!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MSCommand
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/MSCommand!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - MaerskDrilling
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/MaerskDrilling!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - GCMS
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/GCMS!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - BPCRP
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/BPCRP!10!100!
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Inbound Directory Count - CoP_Alaska
check_command check_nrpe!check_dir_files.sh!/GlobalScapeSftpRepo/CoP_Alaska!10!100!
notifications_enabled 0
}
On NRPE server
nrpe.cfg
command[check_dir_files]=/usr/local/nagios/libexec/check_dir_files.sh -d $ARG1$ -w $ARG2$ -c $ARG3$ -f
it works manually on both machines manually
./check_dir_files.sh -d /GlobalScapeSftpRepo/Noble/ -w 10 -c 100 -f
OK - There are 1 files in dir /GlobalScapeSftpRepo/Noble/|'size'=1;10;100
hoping others have set this plugin up or knowledge is deeper than mine(newbie) thank you
I know it is something how the args are defined in statement because of below, execute on nagios server to nrpe server
./check_nrpe -H 3.36.24.89
NRPE v3.2.1
./check_nrpe -H 3.36.24.89 -c check_dir_files
OK - There are 0 files in dir -w