File System

check_windows_files.ps1

Description:

Another plugin to check files in Windows. Meant to be run via an agent like NCPA. Check if a file exists, check the size of a file, check the number of files in a directory.

In 1.2, you now get performance data if you’re checking either the number of files in a directory, or checking the size of a file. Thanks to Terminator81 over on GitHub for the suggestion!

Current Version

1.3

Last Release Date

2022-05-16

Compatible With

  • Nagios 4.x
  • Nagios XI

Owner

License

GPL


Project Files
Project Notes
Nothing terribly special here. Just a 3-in-1 Powershell plugin to check if a file exists, the size of a file, or the number of files in a directory. Let's take a look at the switches. -checkPath Required. This is the path you will use for your check. If you are checking that a file exists, or checking the size of a file, this should point directly to a file. E.g. C:MyCoolfile.txt. This site removes the extra slashes. You need two slashes for every slash. Which brings up the second point. I have not validated the path yet, so make sure you use two backslashes. This is required for the CIM queries. -exists Not required. This is a switch, so just invoking it will get the script started down the path of verifying whether a file exists or not. -shouldnotexist Not required. Another switch, one to be used with -exists. Use this switch if you are checking to see if a file exists, and you want to be alerted that it does exist. -size Not required. This is a switch, and sets the script down the path of checking a file's size, reported in bytes. -sizewarning Not required, integer. The number provided here sets the warning threshold, in bytes. -sizecritical Not required, integer. The number provided here sets the critical threshold, in bytes. -number Not required, switch. Sets the script down the path of monitoring the number of files in a directory. For this, your -checkPath should end in a directory without trailing slashes. E.g. -checkPath C:MyCool -numwarning Not required, integer. The number provided here sets the warning threshold for number of files in the specified directory. -numcritical Not required, integer. The number provided here sets the critical threshold for the number of files in the specified directory.
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
5 (1)
Favorites
0
Views
7,458