Kaseya Community

How to put a variable on Last reboot time

This question is not answered

Hi All,

I am trying to create a procedure which gives users  a pop up to reboot there machines if they haven't rebooted in X amount of days. But for the life of me I can't figure out how to do it.

I am able to pull the the last reboot from vAgentConfiguration/lastReboot

But I am not sure how I can add a check to say if that last reboot time is more then 5 days do this.

Does anyone know how I can achieve this?

Thanks

All Replies
  • I would push that value down to the agent and do the processing in PowerShell. I don't believe there is a way to do date math in the AP itself. For that matter, I push most of all processing down to the agent in PowerShell if for nothing else, they are just much easier to debug and test.

    The majority of my agent procedures follow the pattern:

    1. Write file (XXXX.ps1)

    2. Execute file (XXX.ps1)

    3. Get Results to Variable(results.txt, results)

    4. Write procedure log entry (#results#)

  • You can create a view with this variable in it.  You can also use what has mentioned as well.

    Some clients even use a text file to parse values and use it in comparison.

  • I do this by doing a few things.  As oscar said I have a view that shows workstations with the option "Show machines that have no rebooted in the last 14 days"

    I then have a policy based off that view that runs a procedure every day at 2pm to prompt the user to reboot. It also has a procedure that runs at 1am that checks if a user is logged in and if they aren't, it reboots.

  • We've taken a different approach to this. We developed a maintenance tool that runs on every endpoint. Each day, VSA kicks it off. It has a GUI with the MSP logo that reports status. (see below for main GUI screen) This is a SysTray utility that reports on what's scheduled, what's been done, upcoming scheduled reboots, and more. If the maintenance-based weekly reboots are blocked, then the UptimeCheck task that runs each day will alert to excessive uptime. If the uptime exceeds the lower threshold, a user pop-up is generated asking if the system can be rebooted in 15 minutes. This happens daily until a reboot or the upper threshold is reached, at which point an alert is generated. Woe be the end user that gets a call from the support team to reboot a workstation! This has been very effective at reducing the overall system uptime. Our pop-up is system modal, which means that everything stops until it is acknowledged. We log the user that responded as well as the timestamp, so user's can't say "I never saw that!".

    The settings are configurable globally, per customer, per machine.group, or per agent.

    [UPTIMECK]
    ; Check the uptime and alert if exceeds the specified number of days
    Command=UptimeCheck
    ; Argument is WARN,ALARM value pair
    Arguments=15,35
    LogInfo=Check System Uptime
    ; OPTIONS
    ; WarnEvent is a Boolean value - when TRUE, will generate Warning Event and corresponding tickets (Default=N)
    ; WarnEvent=y
    ; AlarmEvent is a Boolean value - when TRUE, will generate an Error Event and corresponding ticket (Default=Y)
    ; AlarmEvent=n
    ; AlertUser is a Boolean value - when TRUE, will pop up an alert to the user each day in warning state recommending a reboot (Default=Y)
    ; AlertUser=n

    Glenn