[GH-ISSUE #1361] Feature Request: Disk Space Check without Percent #852

Open
opened 2026-03-02 02:19:29 +03:00 by kerem · 2 comments
Owner

Originally created by @rawbyne on GitHub (Dec 2, 2022).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1361

I got lots of servers running. Some of them got a 2 TB or higher capacity. So it would be nice, if I coud setup an Warning if I got only 50 GB free space and a error Threehold on 25 GB free space. The percentage is not practicable in this cases.

Originally created by @rawbyne on GitHub (Dec 2, 2022). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1361 I got lots of servers running. Some of them got a 2 TB or higher capacity. So it would be nice, if I coud setup an Warning if I got only 50 GB free space and a error Threehold on 25 GB free space. The percentage is not practicable in this cases.
Author
Owner

@bcredeur97 commented on GitHub (Dec 8, 2022):

Would like this as well. It's a little frustrating when you have 80TB backup server that is like perfectly sized, and 2% is ~1.6TB

<!-- gh-comment-id:1343336997 --> @bcredeur97 commented on GitHub (Dec 8, 2022): Would like this as well. It's a little frustrating when you have 80TB backup server that is like perfectly sized, and 2% is ~1.6TB
Author
Owner

@dinger1986 commented on GitHub (Dec 8, 2022):

A powershell script would do this well.

Please test the following (copy into your script manager and run with parameters set, happy with any feedback)

<#
      .SYNOPSIS
      This will do a disk space check based on parameters, it defaults to Drive C and 10GB
      .DESCRIPTION
      Checking for disk space based on space not percentage.
      .PARAMETER DriveLetter
      .PARAMETER NoSpace
      .EXAMPLE
      -DriveLetter C
      .EXAMPLE
      -NoSpace 20
      .NOTES
      12/2022 v1 Initial release by @dinger1986
  #>

param (
    [string] $DriveLetter = "C",
    [string] $NoSpace = "10"
)

$space = ((Get-PSDrive $DriveLetter).Free / 1GB)

if ($space -lt $NoSpace) {
    write-output "Disk space warning you have less than $NoSpace GB left"
    Exit 1
}
else {
    write-output "Disk space is fine"
    Exit 0
}
<!-- gh-comment-id:1343388593 --> @dinger1986 commented on GitHub (Dec 8, 2022): A powershell script would do this well. Please test the following (copy into your script manager and run with parameters set, happy with any feedback) ``` <# .SYNOPSIS This will do a disk space check based on parameters, it defaults to Drive C and 10GB .DESCRIPTION Checking for disk space based on space not percentage. .PARAMETER DriveLetter .PARAMETER NoSpace .EXAMPLE -DriveLetter C .EXAMPLE -NoSpace 20 .NOTES 12/2022 v1 Initial release by @dinger1986 #> param ( [string] $DriveLetter = "C", [string] $NoSpace = "10" ) $space = ((Get-PSDrive $DriveLetter).Free / 1GB) if ($space -lt $NoSpace) { write-output "Disk space warning you have less than $NoSpace GB left" Exit 1 } else { write-output "Disk space is fine" Exit 0 } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#852
No description provided.