Hello,
I want to monitor no of files in windows directory and set alert accordingly.
I could not find any solution for windows rather there is alot of help for linux etc.
Please guide.
Thanks
Check file count windows Nagios XI
Check file count windows Nagios XI
Last edited by dwhitfield on Wed Dec 07, 2016 10:20 am, edited 1 time in total.
Reason: marking with green check mark
Reason: marking with green check mark
Re: Check file count windows Nagios XI
Here are some good examples of checking for file counts on Windows using NSClient++
http://sites.box293.com/nagios/guides/c ... es-folders
Will this work for your environment?
http://sites.box293.com/nagios/guides/c ... es-folders
Will this work for your environment?
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: Check file count windows Nagios XI
./check_nrpe -H localhost -t 30 -c check_files -a path='E:\Test\' pattern=*.txt* 'critical=count>0' 'detail-syntax=%(filename): %(size)' 'empty-state=ok'
I have found this command suitable for me.
But it just ensure if no files then ok otherwise generate alert.
My requirement is many files are placed but it should check that if is there any file which comes in directory with automated job. there should be no file older than 15 mints,
check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='E:\\Test\\' pattern=*.* 'filter=written < -2h' 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
I have changed this 'filter=written < -15m' and 'filter=written < -0.25h'
got below error
Failed to validate filter see log for details
Please just guide me how to convert the filter time from hours to time.
Thanks
I have found this command suitable for me.
But it just ensure if no files then ok otherwise generate alert.
My requirement is many files are placed but it should check that if is there any file which comes in directory with automated job. there should be no file older than 15 mints,
check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='E:\\Test\\' pattern=*.* 'filter=written < -2h' 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
I have changed this 'filter=written < -15m' and 'filter=written < -0.25h'
got below error
Failed to validate filter see log for details
Please just guide me how to convert the filter time from hours to time.
Thanks
Re: Check file count windows Nagios XI
The filter syntax has changed slightly between versions. Give the format shared by @ruffsense a try and see if it produces different results.
If it doesn't, can you share which version of NSClient++ you are using?
If it doesn't, can you share which version of NSClient++ you are using?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check file count windows Nagios XI
If the suggestion @ruffsense gave doesn't work for you, can you please post the output of tail -100 /var/log/messages? Thanks!
Re: Check file count windows Nagios XI
filter=written lt 15m does not work.
'filter=written > -15m' working fine...
Thanks
'filter=written > -15m' working fine...
Thanks
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check file count windows Nagios XI
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Re: Check file count windows Nagios XI
Sure please.
Thanks alot
Thanks alot