MacOS
View all Worklets
MacOSmacOS

Display Uptime

Display macOS endpoint uptime and local time for system monitoring

Worklet Details

What the Display Uptime Worklet does

This Automox Worklet™ displays the uptime duration and local time on macOS endpoints. The Worklet uses the native uptime command to retrieve system uptime information and formats it in a readable output that shows both the current local time and how many days, hours, or minutes the endpoint has been running since its last restart.

The Worklet intelligently handles variable uptime formats. If the endpoint has been running for multiple days, the output displays days, hours, and minutes. For endpoints running less than 24 hours, the script displays hours and minutes instead. This maintains the output is always relevant and easy to interpret regardless of endpoint operational duration.

Why monitor macOS endpoint uptime

Without visibility into endpoint uptime, you cannot detect unstable systems that repeatedly crash or restart unexpectedly. When endpoints experience frequent reboots due to hardware failures, driver conflicts, or failed updates, users lose productivity and data, but IT teams remain unaware until users report problems. This lack of uptime monitoring leaves you unable to identify patterns of instability, track update success rates, or verify that endpoints remain available for security patching.

IT Operations teams use uptime data to assess whether endpoints require maintenance, troubleshoot performance issues, and verify that critical services remain available. For organizations managing macOS fleets, having immediate access to uptime information helps identify endpoints that may be experiencing instability or need intervention before users report problems.

The Display Uptime Worklet eliminates the need to log in to each endpoint manually or use external monitoring tools. By automating uptime collection, you gain real-time visibility into endpoint health across your macOS fleet without installing additional agents or software.

How uptime monitoring works

  1. Evaluation phase: The evaluation script immediately triggers remediation on all endpoints without checking any conditions. This ensures the uptime display command runs on every target endpoint.

  2. Remediation phase: The remediation script executes the uptime command and processes the output. The script detects whether uptime is measured in days or hours by checking for the 'days' keyword. For multi-day uptime, it outputs local time and days, hours, and minutes in a formatted message. For uptime under 24 hours, it outputs local time and hours and minutes instead.

Display Uptime requirements

  • macOS endpoint (Workstation or Server type)

  • Bash shell environment

  • Access to the native uptime command

  • awk and sed utilities available

Expected endpoint uptime information

After remediation completes, the Worklet displays a formatted message showing the current local time on the endpoint and the duration since the last restart. For example, an endpoint running for 5 days displays 'Your local time is: [timestamp]. Your machine has been 5 days, 3 hours, 45 minutes.'

Verification and analysis: Review the Activity Log output to identify endpoints with unusually short uptime (indicating recent crashes or forced reboots) or extremely long uptime (potentially missing critical security updates that require restarts). Establish baseline expectations for your macOS fleet based on your update policies. Schedule this Worklet to run regularly to detect patterns of instability. The Worklet is compatible with RunNow, allowing on-demand execution for immediate uptime verification on specific endpoints or groups.

How to validate display uptime changes

  1. Run this Worklet on a pilot macOS endpoint and review evaluation output for display uptime.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as exit.

  4. Validate remediation effects from script operations such as uptime, else, then rerun evaluation for compliance.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets