TracNav
Internal Commands
CheckDisk
CheckEventLog...
CheckSystem...
CheckHelpers...
CheckTaskSched...
FileLogger...
NRPEListener...
NSClientListener...
SysTray...
CheckWMI...
RemoteConfiguration...
CheckExternalScripts...
LUAScript...
NSCAAgent...
Documentation...
Getting Started...
Information...
Sponsoring...
- ==External Scripts==
Donate...
CheckDriveSize
CheckDriveSize is part of the CheckDisk module
This check verifies the size of various drives specified on the command line. A request has one or more options described in the table below. The order only matters in that the size has to be specified before the Drive option because you can change the size for each drive by specifying multiple Size options.
| Option | Values | Description |
| MaxWarnFree | size-value or % | The maximum allowed free space for the drive(s). |
| MaxCritFree | size-value or % | The maximum allowed free space for the drive(s). |
| MinWarnFree | size-value or % | The minimum allowed free space for the drive(s). |
| MinCritFree | size-value or % | The minimum allowed free space for the drive(s). |
| MaxWarnUsed | size-value or % | The maximum allowed used space for the drive(s). |
| MaxCritUsed | size-value or % | The maximum allowed used space for the drive(s). |
| MinWarnUsed | size-value or % | The minimum allowed used space for the drive(s). |
| MinCritUsed | size-value or % | The minimum allowed used space for the drive(s). |
| ShowAll | Empty, long | If present will display information even if an item is not reporting a state. If set to long will display more information. |
| Drive | A Drive letter or the path of a mounted Volume | The letter of the drive to check. |
| FilterType | FIXED, CDROM, REMOVABLE, REMOTE | Filter for drive type to prevent checking drives of certain kinds (most useful when using CheckAll?). The default is FIXED |
| CheckAll | None,volumes | Check all available drives. Volume support is available since (0.3.8) |
| CheckAllOthers | None | Check all drives (matching Filters) except those specified in the Drive= clause. |
| ignore-perf-data | A boolean flag to disable returning performance data |
The size-value or % is a normal numeric-value with an optional unit or percentage postfix to specify large sizes. The available postfixes are B for Byte, K for Kilobyte, M for Megabyte, G for Gigabyte and finally % for percent free space.
Examples
Check C:
Check the size of C:\ and make sure it has 10% free space:
Sample Command:
CheckDriveSize ShowAll MinWarnFree=10% MinCritFree=5% Drive=c:\
CRITICAL: C:: Total: 74.5G - Used: 71.2G (95%) - Free: 3.28G (5%) < criticalNagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a ShowAll MinWarnFree=$ARG2$ MinCritFree=5% Drive=c:\
}
<<CheckDriveSize>> c:,5%!10%
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a ShowAll MinWarnFree=10% MinCritFree=5% Drive=c:\
Volumes
To check the size of mounted volume c:\volumne_test and make sure it has 1M free space
Sample Command:
CheckDriveSize ShowAll MaxWarn=1M MaxCrit=2M Drive=c:\volumne_test
CRITICAL: C:: Total: 74.5G - Used: 71.2G (95%) - Free: 3.28G (5%) < criticalNagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$ Drive=$ARG1$
}
<<CheckDriveSize>> c:\volumne_test!1M!2M
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a ShowAll MaxWarn=1M MaxCrit=2M Drive=c:\volumne_test
Volumes
To check the size of all volume has 1M free space
Sample Command:
CheckDriveSize ShowAll MaxWarn=1M MaxCrit=2M CheckAll=volumes
CRITICAL: C:: Total: 74.5G - Used: 71.2G (95%) - Free: 3.28G (5%) < criticalNagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$ CheckAll=volumes
}
<<CheckDriveSize>> c:\volumne_test!1M!2M
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a ShowAll MaxWarn=1M MaxCrit=2M CheckAll=volumes
All fixed and network disks
To check the size of all fixed and network drives and make sure they have at least 1gig free space
Sample Command:
CheckDriveSize MinWarn=50% MinCrit=25% CheckAll FilterType=FIXED FilterType=REMOTE
CRITICAL: C:\;76514398208;1073741824;536870912; D:\;199303897088;1073741824;536870912; X:\;35467034624;1073741824;536870912; Y:\;299649466368;1073741824;536870912;Nagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a MinWarn=$ARG2$ MinCrit=$ARG1$ CheckAll FilterType=FIXED FilterType=REMOTE
}
<<CheckDriveSize>> 25%!50%
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a MinWarn=50% MinCrit=25% CheckAll FilterType=FIXED FilterType=REMOTE
Fixed and Network (ignore some)
Check all fixed and network drives but ignore C and F. Not sure about this (should be simpler ways)
Sample Command:
CheckDriveSize CheckAllOthers FilterType=FIXED FilterType=REMOTE MinWarn=25% MinCrit=50% Drive=C Drive=F
OK: ...Nagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a CheckAllOthers FilterType=FIXED FilterType=REMOTE MinWarn=$ARG1$ MinCrit=$ARG2$ Drive=C Drive=F
}
<<CheckDriveSize>> 25%!50%
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a CheckAllOthers FilterType=FIXED FilterType=REMOTE MinWarn=25% MinCrit=50% Drive=C Drive=F
Checking UNC Paths
Important to not forget the trailing \.
Sample Command:
CheckDriveSize Drive=x:\ FilterType=REMOTE ShowAll MaxWarnUsed=90% MaxCritUsed=95%
OK: ...Nagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a Drive=x:\ FilterType=REMOTE ShowAll MaxWarnUsed=90% MaxCritUsed=$ARG2$
}
<<CheckDriveSize>> x:,90%!95%
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a Drive=x:\ FilterType=REMOTE ShowAll MaxWarnUsed=90% MaxCritUsed=95%
Simple Config
Another example for a working config.
Sample Command:
CheckDriveSize Drive=c:\\volumes\\somevolume\\ ShowAll MaxWarnUsed=90% MaxCritUsed=95%
OK: ...Nagios Configuration:
define command {
command_name <<CheckDriveSize>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a Drive=c:\\volumes\\somevolume\\ ShowAll MaxWarnUsed=90% MaxCritUsed=$ARG2$
}
<<CheckDriveSize>> c:\\volumes\\somevolume\,90%!95%
From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckDriveSize -a Drive=c:\\volumes\\somevolume\\ ShowAll MaxWarnUsed=90% MaxCritUsed=95%







