Home Directory Plugins Operating Systems Windows NRPE Updated: Check Free Disk Space (check_disk)

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Updated: Check Free Disk Space (check_disk)

Rating
0 votes
Favoured:
0
Last Release Date
2021-04-08
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
Hits
7120
Files:
FileDescription
check_disk.vbscheck_disk script
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This is an updated and modified version of check free disk space (https://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows-NRPE/Check-free-disk-space/details)

Modified by Corey Davis April 8, 2021
' Added disclaimer for using an undefined /d: for an argument to the help display
' Added ALL scope to parameter /d to tell it to use ALL disks on the system
' Removed the error catch-all for undefined drives or no drives on the system
' Fixed DriveSeleted function logically and added the ALL flag
' Moved the case assignments to inside the loop so it can build the correct responses for all specified drives
' Fixed formatting outdrive output to make it more readable
' Changed errorStatus to use the highest error code for the global script output so that Nagios will show the correct status, OK, WARNING, CRITICAL
'
This is an updated and modified version of check free disk space (https://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows-NRPE/Check-free-disk-space/details)

I would like to submit this to the original author, but I created this instead.

Check free space on windows partitions. It tries to resemble as much as possible with check_disk from the Official Nagios Plugin package.

** Modified Barry W. Alder 2013/09/24
changed code so that an error is reported if no disks are found with the /x flag and an error is reported if the disk specified in the /d flag is not found



It checks all partitions, a list or all but an exclusion list.
Limits can be in % or in standard units (B | kB | MB | GB)

Results are displayed in standard Nagios format.

nrpe.cfg config file declaration:
command[check_disk]=c:Windowssystem32cscript.exe //NoLogo //T:10 c:adminnrpecheck_disk.vbs /w:$ARG1$ /c:$ARG2$ /p /d:$ARG3$ /x:$ARG4$ /u:GB

Connand line syntax:
cscript //Nologo check_disk.vbs /w:INTEGER /c:INTEGER [/p] [/d:DRIVE_LIST | /x:DRIVE_LIST] [/u:UNITS] [/h]

/w: warning limit

/c: critical limit

/p: limits in %, otherwise in UNITS

/d: included drives list

/x: excluded drives list

/u: B | kB | MB | GB, default MB

/h: this help
"!!!!!You MUST specify a drive list or ALL for the /d parameter. If not the script will give no output!!!!!"
check_disk.vbs /w:15 /c:5 /p /d:CDE /u:kB - result will be displayed in kB, limits are in percents

check_disk.vbs /w:500 /c:250 /d:ALL - result will be displayed in MB, limits are in MB, all fixed drives
check_disk.vbs /w:500 /c:250 - result will be displayed in MB, limits are in MB, all fixed drives

Modified by Corey Davis April 8, 2021
' Added disclaimer for using an undefined /d: for an argument to the help display
' Added ALL scope to parameter /d to tell it to use ALL disks on the system
' Removed the error catch-all for undefined drives or no drives on the system
' Fixed DriveSeleted function logically and added the ALL flag
' Moved the case assignments to inside the loop so it can build the correct responses for all specified drives
' Fixed formatting outdrive output to make it more readable
' Changed errorStatus to use the highest error code for the global script output so that Nagios will show the correct status, OK, WARNING, CRITICAL