File Age is not working as expected for Windows machine.
File Age is not working as expected for Windows machine.
Hi,
We instrumented monitoring f file slms.* stuck in the folder more than 5 minutes then Nagios will triggered Alert.
It's capturing the files correctly however nagios is not changing the status even after files removed from the directory.
Command View : $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c $ARG1$ $ARG2$
check_files -a path='<FilePath>' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
Thanks & Regards,
Avinash
We instrumented monitoring f file slms.* stuck in the folder more than 5 minutes then Nagios will triggered Alert.
It's capturing the files correctly however nagios is not changing the status even after files removed from the directory.
Command View : $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c $ARG1$ $ARG2$
check_files -a path='<FilePath>' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
Thanks & Regards,
Avinash
Re: File Age is not working as expected for Windows machine.
Can you elaborate on that? Do you mean the check correctly shows that the files were removed, but still exits with a "non-OK" status?It's capturing the files correctly however nagios is not changing the status even after files removed from the directory.
I haven't been able to recreate the issue. I started off with adding two zip files in the D:\TEMP directory on my workstation. The check returned CRITICAL:
Code: Select all
[root@main-nagios-xi libexec]# ./check_nrpe -H x.x.x.x -c check_files -a path='D:\TEMP' pattern=*.zip 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
CRITICAL: 2 files found|'count'=2;0;0
[root@main-nagios-xi libexec]# echo $?
2Code: Select all
[root@main-nagios-xi libexec]# ./check_nrpe -H x.x.x.x -c check_files -a path='D:\TEMP' pattern=*.zip 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
OK: No files found|'count'=0;0;0
[root@main-nagios-xi libexec]# echo $?
0Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: File Age is not working as expected for Windows machine.
Can you elaborate on that? Do you mean the check correctly shows that the files were removed, but still exits with a "non-OK" status?
yes, files which are start from 'slms' are not available in F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import directory on endpoint server but status is showing 3 files found.
Please find below output for same.
[nagios@<NagiosXIServer> ~]$ /usr/local/nagios/libexec/check_nrpe -H <Host IP Address> -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
CRITICAL: 3 files found|'count'=3;0;0
Status should be in OK status with 0 file found.
yes, files which are start from 'slms' are not available in F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import directory on endpoint server but status is showing 3 files found.
Please find below output for same.
[nagios@<NagiosXIServer> ~]$ /usr/local/nagios/libexec/check_nrpe -H <Host IP Address> -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
CRITICAL: 3 files found|'count'=3;0;0
Status should be in OK status with 0 file found.
Re: File Age is not working as expected for Windows machine.
Can you show us a screenshot with the files that do exist in the "F:\RedPrairie\LABOR\LES\files\hostout\import" folder?
Again, I was not able to recreate the issue. I tried a "similar" setup.
After deleting the files, the check returned OK:
Again, I was not able to recreate the issue. I tried a "similar" setup.
Code: Select all
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 60 -c check_files -a path='D:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -1m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
CRITICAL: 3 files found|'count'=3;0;0Code: Select all
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.5.18 -t 60 -c check_files -a path='D:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -1m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
OK: No files found|'count'=0;0;0You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: File Age is not working as expected for Windows machine.
Hi,
I checked and found there is no file present on the path F:\RedPrairie\LABOR\LES\files\hostout\import starting with the name slms.*. But still on the Nagios console metric status is showing as in the CRITICAL state and it should be in the OK state becuase file is not there.
I am attaching the snapshot below.
I checked and found there is no file present on the path F:\RedPrairie\LABOR\LES\files\hostout\import starting with the name slms.*. But still on the Nagios console metric status is showing as in the CRITICAL state and it should be in the OK state becuase file is not there.
I am attaching the snapshot below.
You do not have the required permissions to view the files attached to this post.
Re: File Age is not working as expected for Windows machine.
The critical message in the Nagios GUI, how many files does it say is creating the Critical Alert?
Is there any subfolders that could be holding a file or files with the slms.* pattern?
What version of NSClient++ are you running on the Windows server?
Is there any subfolders that could be holding a file or files with the slms.* pattern?
What version of NSClient++ are you running on the Windows server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: File Age is not working as expected for Windows machine.
Yes , Critical message is showing on the Nagios GUI and 3 files showing on Nagios GUI with critical error message [ CRITICAL: 3 files found].
There is no any other folder on this path F/RedPrairie/LABOR/LES/files/hostout/import/slms which contains slms.* files.
We are using Nagios 5.5.10 version.
Thanks..
There is no any other folder on this path F/RedPrairie/LABOR/LES/files/hostout/import/slms which contains slms.* files.
We are using Nagios 5.5.10 version.
Thanks..
You do not have the required permissions to view the files attached to this post.
Re: File Age is not working as expected for Windows machine.
To get the version of the NSCLient++ agent, run this command on the Nagios server and post the output so we can see it.
One suggestion is to upgrade to the latest stable release of NSClient++ and the following link is where it can be downloaded from.
http://nsclient.org/download/0.5.2/
Can you run this example command as well and post the output to the ticket? I added the folder \\slms to the path as the earlier example it is missing.
Also, go th the following folder on the Windows system and get the nsclient.ini and the nsclient.log file and post it here.
Thanks.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <Host IP Address>http://nsclient.org/download/0.5.2/
Can you run this example command as well and post the output to the ticket? I added the folder \\slms to the path as the earlier example it is missing.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <Host IP Address> -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import\\slms' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'top-syntax=${status}: ${count} files found' 'empty-syntax=${status}: No files found' Code: Select all
C:\Program Files\NSClient++Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: File Age is not working as expected for Windows machine.
Nsclient Version :
[nagios@Nagiosserver~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116
I (0.5.1.44 2017-08-30) seem to be doing fine...
Below is the output of the command:
[nagios@Nagiosserver~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116 -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'top-syntax=${status}: ${count} files found' 'empty-syntax=${status}: No files found'
CRITICAL: 3 files found|'count'=3;0;0
PFA nsclient.ini and the nsclient.log file from the windows server.
[nagios@Nagiosserver~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116
I (0.5.1.44 2017-08-30) seem to be doing fine...
Below is the output of the command:
[nagios@Nagiosserver~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116 -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'top-syntax=${status}: ${count} files found' 'empty-syntax=${status}: No files found'
CRITICAL: 3 files found|'count'=3;0;0
PFA nsclient.ini and the nsclient.log file from the windows server.
You do not have the required permissions to view the files attached to this post.
Re: File Age is not working as expected for Windows machine.
Attaching the nsclient.ini file. Please find attachment
You do not have the required permissions to view the files attached to this post.