Monitoring Specific Windows Drive

Options
gio
gio Member Posts: 5
edited December 2023 in Remote Monitoring

So let me paint the scenario. We have a 24x7 customer who has a group of Windows 2012R2 or later servers we currently monitor using ConnectWise Automate. ConnectWise recently informed us that they no longer support Windows Server 2012R2, which is unacceptable and we want to maybe move to the Altera platform. These SQL servers are very busy servers, and we need to not only monitor drive space on the system drive (C:), but also drive S: (SQL Data) and L: (SQL Logs). I don't mind setting a threshold for C: at 20%, but S: and L: need to be at <50% free space for alerting. I want to be able to set individual thresholds for each drive. Can this be done?

Comments

  • tanderson
    tanderson Member Posts: 196 ✭✭✭✭
    Options

    @gio I believe you can do this with an alert profile here is a video that shows that and how to add scripts to resolve things automatically.

    Ateraverse Recap on Atera's automations tips and tricks

    Start at about 11:30 in.

  • DP
    DP Member Posts: 51 ✭✭
    Options

    Yes the threshold item allows multiple space threshold items - can exclude drives you don't want a threshold item to monitor.

  • mbudke
    mbudke Member Posts: 85 ✭✭✭
    Options

    Hi,

    I think for this case it would be the easiest to go for a script.
    Just create a script which goes through all your HDDs and define per drive a threshold. In case that the threshold is reached then return a "1" otherweise return a "0".

    In case of a returnvalue of "1" you can start an alert. I believe if it is drive C, D or E does not matter since you have to connect anyway as it already reached the threshold. :)

    Matthias

  • nina
    nina Administrator Posts: 428 admin
    Options
  • kim
    kim Member Posts: 113 ✭✭✭
    Options

    I know there is a script in the shared library that can get the information of the drives that you need. if you go to https://app.atera.com/new/admin/scripts and search for "Get-DriveInformation", it will return the sizes. @Matthias have you been able to submit this as a script in the library that can be run on the environment? If not, that would be amazing if you would be able to. I know I would love to use it.

  • mbudke
    mbudke Member Posts: 85 ✭✭✭
    Options

    Hi @kim ,

    I do not have a script in the library but you can easily create it by e.g. ChatGPT or the integration in Atera itself.

    Please find an example below which checks the drive C:/
    In case that the drive space is less than 10 percent it returns a 1 otherwise a 0. Basically you can combine the check of multiple drives.

    Get the drive information for C:\
    $drive = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'"
    Calculate the used space percentage
    $usedSpacePercentage = [math]::Round(($drive.FreeSpace / $drive.Size) * 100)
    Check if the used space percentage is less than or equal to 10 (more than 90% used)
    if ($usedSpacePercentage -le 10) {
    Write-Output "1"
    } else {
    Write-Output "0"
    }

    Matthias

  • nina
    nina Administrator Posts: 428 admin
    Options

    Thank you @kim and @Matthias !