Re: Check Number Files in a directory
Posted: Tue Apr 12, 2016 2:33 am
Hum, I'm working on Nagios 4.1.1 on a Debian Jessie, i think it's different to Nagios XI server no ??
So, today, i've in command.cfg :
In windows.cfg, I've tested 2 services, the first like my colleague used it on our old Nagios Windows, the second like this is written on check_files.vbs in the directory script to NSCLIENT++ 0.4.4 :
====> When i restart nagios and test it : I've on the both services,
Number of files on Request
UNKNOWN 12-04-2016 09:27:19 0d 0h 17m 15s 3/3 Invalid command line: unrecognised option '/path:c:GESTIONREQUEST'
Number of files on Request 2
UNKNOWN 12-04-2016 09:22:12 0d 0h 12m 22s 3/3 Invalid command line: unrecognised option '/path:c:GESTIONREQUEST'
So, when i run the command in /usr/local/nagios/libexec : ./check_nrpe -H @IPofmyserver -c check_files -a path=c:/GESTION/REQUEST
for the FIRST TIME, it works !!! and the output is :
OK: All 2 files are ok.
But i still not understand what I need to wrote on path in the descriptions of the service
So, today, i've in command.cfg :
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
define command{
command_name CheckNumberFiles
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Code: Select all
define service{
use generic-service
host_name NAME OF MY SERVER
notification_interval 20
service_description Number of files on Request
check_command CheckNumberFiles!check_files!/path:"c:\\GESTION\\REQUEST" /searchdepth:1 /selage:ignore /warning:5 /critical:10
}
define service{
use generic-service
host_name NAME OF MY SERVER
notification_interval 20
service_description Number of files on Request 2
check_command check_nrpe!check_files!/path:"c:\\GESTION\\REQUEST" /searchdepth:1 /selage:ignore /warning:5 /critical:10
}
Number of files on Request
UNKNOWN 12-04-2016 09:27:19 0d 0h 17m 15s 3/3 Invalid command line: unrecognised option '/path:c:GESTIONREQUEST'
Number of files on Request 2
UNKNOWN 12-04-2016 09:22:12 0d 0h 12m 22s 3/3 Invalid command line: unrecognised option '/path:c:GESTIONREQUEST'
So, when i run the command in /usr/local/nagios/libexec : ./check_nrpe -H @IPofmyserver -c check_files -a path=c:/GESTION/REQUEST
for the FIRST TIME, it works !!! and the output is :
OK: All 2 files are ok.
But i still not understand what I need to wrote on path in the descriptions of the service