Releasing soon Vigo is in alpha and closing in on its first stable release. Expect breaking changes between releases until then — we're looking for testing partners with meaningful fleets across diverse architectures. Learn more →

Uptime (Windows)

Reports system uptime in seconds and the last boot time on Windows.

Trait Path

uptime

Fields

Path Type Example Description
uptime.seconds integer 86400 System uptime in seconds
uptime.boot_time string "20260312083045.123456+000" Last boot time in WMI datetime format

Collection Method

Runs wmic os get LastBootUpTime /value and parses the WMI datetime format (yyyyMMddHHmmss.ffffff+UUU). The boot epoch is computed from the datetime string, accounting for the UTC offset suffix. Uptime is calculated by subtracting the boot epoch from the current Unix time.

Using in When Expressions

- name: post-reboot-check
  type: exec
  command: C:\scripts\post-reboot.ps1
  when: "os_family('windows')"

Using in Templates

- name: uptime-report
  type: file
  target_path: C:\ProgramData\vigo\uptime.txt
  content: |
    Uptime: {{ .Traits.uptime.seconds }} seconds

Platform

Windows