How to check Folder accessibility and files
How to check Folder accessibility and files
Team,
Please help me how to configure monitoring in nagios, whether a folder in windows server is accessible or not and also need to report alert if no files available in that folder.
Please help me how to configure monitoring in nagios, whether a folder in windows server is accessible or not and also need to report alert if no files available in that folder.
Re: How to check Folder accessibility and files
Okay, a couple of quick questions. Are you running an agent on the Windows machine, like NCPA? Also, when you say "check if a folder is accessible," do you mean accessible by a specific user, or might the directory just not exist?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to check Folder accessibility and files
No we are not running with agents on remote windows servers. We are using WMI.Are you running an agent on the Windows machine, like NCPA?
Is it mandatory to monitor remote machines with agent ?
Is agent monitoring is better than WMI monitoring ?
Yes.lso, when you say "check if a folder is accessible," do you mean accessible by a specific user, or might the directory just not exist?
We need to monitor in below two cases for the folder. This is the requirement from client.
Not able to access folder & no files in folder.
I will check whether authencation is available or not meanwhile.
Re: How to check Folder accessibility and files
No, you don't have to use an agent for monitoring. It does make things quite a bit easier, but we definitely understand that not all environments tolerate agents.
You should be able to accomplish what you need by going through WMI. Unfortunately we are not experts with WMI, so we can't help you build the query you need for this. But if you run in to a problem with the check_wmi plugin, we can definitely help there. I would highly recommend keeping this link handy,
https://www.computerhope.com/wmic.htm
I've been working with it a little bit, and I think the fsdir will be a helpful alias for this. But I haven't been able to narrow it down to a specific file or directory just yet. So far I can only get it to walk the entire file system structure, which takes quite a bit of time, as you can imagine.
You should be able to accomplish what you need by going through WMI. Unfortunately we are not experts with WMI, so we can't help you build the query you need for this. But if you run in to a problem with the check_wmi plugin, we can definitely help there. I would highly recommend keeping this link handy,
https://www.computerhope.com/wmic.htm
I've been working with it a little bit, and I think the fsdir will be a helpful alias for this. But I haven't been able to narrow it down to a specific file or directory just yet. So far I can only get it to walk the entire file system structure, which takes quite a bit of time, as you can imagine.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to check Folder accessibility and files
I too not that much good at wmi and its usages and how to work them in Nagios.
Let me know the solution which you can provide to us whether its via agent or non-agent.
Provide me steps , i will work on that.
Let me know the solution which you can provide to us whether its via agent or non-agent.
Provide me steps , i will work on that.
Re: How to check Folder accessibility and files
You can try using the check_wmi_plus.pl plugin, which is installed by default in Nagios XI.
Example check that returns critical if there are files in the D:/TEMP folder:
Example check that returns ok if there are no files in the D:/TEMP folder:
You can view the help menu (usage) of the plugin by running:
See some examples here:
https://edcint.co.nz/checkwmiplus/faq/c ... and-lines/
Here's a couple of links to documents that might be useful to you if you decide to try this plugin:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://support.nagios.com/kb/article/n ... g-579.html
Example check that returns critical if there are files in the D:/TEMP folder:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -u username -p password -m checkfoldersize -a D:/TEMP --nodatamode -c 0
CRITICAL - [Triggered by _FolderSize>0] - Folder D:/TEMP/ is 14.381KB. Found 2 files(s). (List is on next line)|'D:/TEMP/ Size'=14726B;;0; 'File Count'=2;
The file(s) found are d:\temp\check_nna.pyExample check that returns ok if there are no files in the D:/TEMP folder:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -u username -p password -m checkfoldersize -a D:/TEMP --nodatamode -c 0
OK - Folder D:/TEMP/ is 0B. Found 0 files(s).|'D:/TEMP/ Size'=0B;;0; 'File Count'=0;Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl --helphttps://edcint.co.nz/checkwmiplus/faq/c ... and-lines/
Here's a couple of links to documents that might be useful to you if you decide to try this plugin:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://support.nagios.com/kb/article/n ... g-579.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to check Folder accessibility and files
Thank you very much for the update, this really helps.
Im following up to get username and password for that folder with client. Once I get I will check this.
And also is there any argument to verify whether the destination folder exists/accesible or not.
Im following up to get username and password for that folder with client. Once I get I will check this.
And also is there any argument to verify whether the destination folder exists/accesible or not.
Re: How to check Folder accessibility and files
I didn't find an option in the plugin's help menu that can provide this functionality. There may be a way to run a WMI query for verify that folder exists. Creating and executing this query is out of scope of Nagios support, but this is a guide that can get you started:And also is there any argument to verify whether the destination folder exists/accesible or not.
https://docs.microsoft.com/en-us/previo ... echnet.10)
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to check Folder accessibility and files
Thanks for this. We are testing on this.
So, now its for storage device which I require help from you. To monitor accessibility and file availability on a shared path.
//xx.xx.xx.xx/Folder1/Folder2/
Inside this folder2, files should be present.
We have username/password to access, I checked that from desktop provided credentials working and im able to access the shared path.
Kindly help me how to do the monitoring in Nagios.
So, now its for storage device which I require help from you. To monitor accessibility and file availability on a shared path.
//xx.xx.xx.xx/Folder1/Folder2/
Inside this folder2, files should be present.
We have username/password to access, I checked that from desktop provided credentials working and im able to access the shared path.
Kindly help me how to do the monitoring in Nagios.
Re: How to check Folder accessibility and files
I do not believe this is possible, but you could try contacting Microsoft support and see if there is a WMI query that would allow you to monitor accessibility and file availability on a shared path. In any case, you won't be able to achieve your goal by simply using the "check_wmi_plus.pl" plugin as this functionality is not available.
Be sure to check out our Knowledgebase for helpful articles and solutions!