Skip to main content

System Variables

Built-in variables that expose device and group context in any automation or script that supports variable rendering.

Introduction

System variables are built-in variables available in every automation and script — no setup required. They expose live device and group metadata at run time: hostname, IP addresses, group name, tags, and more.

Use them anywhere variable rendering is supported: script actions, shell commands, notification messages, HTTP requests, or custom field values.


System Variables

All system variables use the level_ prefix.

Variable

Description

level_time

Current time in ISO 8601 format

level_device_id

Internal unique identifier for the device

level_device_hostname

The hostname of the device

level_device_nickname

The custom nickname assigned to the device

level_device_public_ip_address

The device’s external IP address

level_device_private_ip_addresses

Comma-separated list of internal IP addresses

level_device_architecture

Device CPU architecture

level_device_cpu_cores

Number of CPU cores

level_device_memory

Total memory in raw bytes

level_device_memory_formatted

Total memory, human-readable (e.g. 16 GB)

level_device_os

Operating system name

level_device_os_version

OS version string

level_device_manufacturer

Hardware manufacturer reported by the device (e.g. Dell Inc.)

level_device_model

Hardware model reported by the device (e.g. OptiPlex 7090)

level_device_last_boot_at

Last reboot time in ISO 8601 format

level_device_last_seen_at

Last seen time in ISO 8601 format

level_device_first_seen_at

Time the device was first added to Level, in ISO 8601 format

level_device_online

Whether the device is currently online: true or false

level_device_maintenance_mode

Whether the device is currently in maintenance mode: true or false

level_device_restart_required

Whether the device is waiting on a restart: true or false

level_group_id

ID of the group the device belongs to

level_group_name

Name of the group the device belongs to

level_group_path

Full path of the group (e.g. HQ / Servers)

level_tag_names

Comma-separated list of tag names applied to the device

level_tag_ids

Comma-separated list of tag IDs applied to the device

ℹ️ NOTE: The three yes/no variables (level_device_online, level_device_maintenance_mode, level_device_restart_required) render as the text true or false, so compare them as strings in your scripts. Variables the device hasn’t reported yet, such as level_device_manufacturer on a machine with no hardware inventory, render as an empty string.


Using System Variables

To insert a system variable into an action, click the variable icon in any field that supports variable rendering and select from the list. System variables appear alongside any automation variables defined for that automation.

To reference a variable in a script directly, use the {{variable_name}} syntax:

echo "Running on {{level_device_hostname}} in {{level_group_path}}"

💡 TIP: level_group_path is useful for scripts that need to behave differently based on where a device sits in your group hierarchy — without needing a separate automation per group.


FAQ

  • Do I need to define system variables before using them? No. System variables are always available in every automation and script. They don’t appear in the Variables tab because they’re not per-automation — they’re global.

  • What if a device doesn’t have a nickname?level_device_nickname returns an empty string if no nickname has been set. Use level_device_hostname as a fallback if you need a value that’s always present.

  • Can I use system variables in action conditions? Yes. Any field that supports variable rendering — including condition values — can reference system variables.

Did this answer your question?