Alert for machine not restarted for x days

Options
Jason Lawrence
Jason Lawrence Member Posts: 5

Hi All, is it possible to create an alert where a machine has not been restarted for x days ?

Thanks

Jason

Tagged:

Comments

  • DP
    DP Member Posts: 51 ✭✭
    Options

    I think it would be possible to great a custom, script-based threshold item. But it would be more manageable, if you used advanced report with a look that displays desktops that haven't rebooted in X days - I currently do this. Then you would just schedule to send that via email when you like.

    I have a dashboard with, pending reboots, new agents, no reboot 21 days, last reboot, etc that works well.

    DP

  • Jason Lawrence
    Jason Lawrence Member Posts: 5
    Options

    Great, i'll look at the reporting solution

  • sarah+success
    sarah+success Administrator Posts: 70 admin
    Options

    Hey @Jason Lawrence , Sarah from Atera here.

    Keep the community posted on how the reports/script-based threshold works for you! Always helpful to hear how Atera clients are utilizing features.

  • Jason Lawrence
    Jason Lawrence Member Posts: 5
    Options

    Hi @Sarah_from_Atera , I can't do the report solution as my plan doesn't include the Advanced Reports :(

    I'll see if I can find a way using script-based threshold

  • sarah+success
    sarah+success Administrator Posts: 70 admin
    Options

    Hey @Jason Lawrence, if you are interested in checking out the Advanced Reporting, check out this demo. You can then upgrade by going to Admin > Subscription.

  • frank.pietersma
    frank.pietersma Member Posts: 78 ✭✭✭
    Options

    Reporting uptime should not be an advanced feature behind a paywall but should be for anyone to use. It is such a basic thing.

  • Jason Lawrence
    Jason Lawrence Member Posts: 5
    Options

    Created a script based threshold profile using the following PS code:

    $lastbootuptime = (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime

    $currentdate = Get-Date

    $noofdayssincelastbootup = ($currentdate - $lastbootuptime).Days

    return $noofdayssincelastbootup

  • DP
    DP Member Posts: 51 ✭✭
    edited August 2023
    Options

    I'm still getting my head around how script based alerts work - did you set it up like this?

    Yup just tried it! Now I'll send a pop-up telling the user to restart asap ; ) too easy.


  • Jason Lawrence
    Jason Lawrence Member Posts: 5
    Options

    Exactly.

    Unfortunately if Fast Startup is enabled, which it is by default, then this tells you when the machine last restarted, not when it was last shutdown and powered on by the user. I've decided to disable Fast Startup for all users, using this script, so now I get a true reading of who has not restarted/powered off & on.

    $RegistryPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power'
    $Name = 'HiberbootEnabled'
    $Value = '0'

    If (-NOT (Test-Path $RegistryPath)) {
    New-Item -Path $RegistryPath -Force | Out-Null
    }

    New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force

  • DP
    DP Member Posts: 51 ✭✭
    Options

    Thanks for the script - I'm finding a bunch of computer's aren't installing updates because fast startup. Users shutdown, but the computer hasn't 'restarted' and they therefore still are being asked to restart.