Hi,
We have already added monitoring for file count and file age of specific folders. But now we want monitoring for only specific file types in a folder example pdf files. Can you please guide us how to add monitoring of specific file type.
Thanks & Regards,
Neha Agarwal
Hoegh Autoliners
Monitoring for only specific file types in a folder
Re: Monitoring for only specific file types in a folder
If you are using NSClient++, you could try the "check_winfile" plugin:
https://www.itefix.net/check_winfile
Here's an example of how I set it up for testing purposes...
In the "nsclient.ini" I have:
In my "tmp" folder on my workstation, I have 3 pdf files:
I tested the check from the CLI on the Nagios XI box:
I hope this helps.
https://www.itefix.net/check_winfile
Here's an example of how I set it up for testing purposes...
In the "nsclient.ini" I have:
Code: Select all
check_winfile = scripts\check_winfile.exe //T:30 //NoLogo $ARG1$Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_winfile -a '--target c:\tmp --filter "name match pdf" --warn 3 --critical 5'
FILE OK - 3 files out of 6 to consider |'selected files'=3;3;5 'all files'=6 'deleted files'=0
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_winfile -a '--target c:\tmp --filter "name match pdf" --warn 2 --critical 3'
FILE WARNING - 3 files out of 6 to consider |'selected files'=3;2;3 'all files'=6 'deleted files'=0
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_winfile -a '--target c:\tmp --filter "name match pdf" --warn 1 --critical 2'
FILE CRITICAL - 3 files out of 6 to consider |'selected files'=3;1;2 'all files'=6 'deleted files'=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!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Monitoring for only specific file types in a folder
With NSClient++ it has a built in module called CheckFiles.
All you need to do is adjust the pattern argument, like pattern='*.pdf'
I have a bunch of examples here:
http://sites.box293.com/nagios/guides/c ... es-folders
All you need to do is adjust the pattern argument, like pattern='*.pdf'
I have a bunch of examples here:
http://sites.box293.com/nagios/guides/c ... es-folders
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitoring for only specific file types in a folder
We have successfully added monitoring of pdf files in Nagios. Thanks a lot for your guidance. 
Thanks & Regards,
Neha Agarwal
Hoegh Autoliners
Thanks & Regards,
Neha Agarwal
Hoegh Autoliners
Re: Monitoring for only specific file types in a folder
Glad to hear it!HAL wrote:We have successfully added monitoring of pdf files in Nagios. Thanks a lot for your guidance.
Thanks & Regards,
Neha Agarwal
Hoegh Autoliners
I am going to close this topic. Please let us know if you have any other issues.
Thanks.
Former Nagios Employee.
me.
me.