Skip to main content
Question

How to check last restart in JSS (Jamf)

  • November 4, 2016
  • 5 replies
  • 126 views

Forum|alt.badge.img+5

How do I check to see when the user restarted the computer in JSS ?

5 replies

stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • November 4, 2016

@Zohaib24 AFAIK to do this you'll need to use an Extension Attribute. You can grab either the uptime of a computer or the last reboot. You can read about either method in this thread:

Create an extension attribute that reports last reboot for a mac

I have an EA for both methods, both from that discussion, but the reboot one is this:

#!/bin/bash

echo "<result>$(date -jf "%s" "$(sysctl kern.boottime | awk -F'[= |,]' '{print $6}')" +"%Y-%m-%d %T")</result>"

Forum|alt.badge.img+26
  • Esteemed Contributor
  • November 4, 2016


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • November 4, 2016

@Sandy ah, yes, forgot about that. However, you have to have Computer Usage enabled for that data to be gathered. We do not collect that data here, hence the EA.


Forum|alt.badge.img+26
  • Esteemed Contributor
  • November 4, 2016

And if you want to know where to check or un-check that option :


Forum|alt.badge.img
  • New Contributor
  • September 7, 2018

Zohaib24's solution worked like a charm. Thanks!