Zum Hauptinhalt springen

System Variables

Heute aktualisiert

Einführung

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

Beschreibung

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

Betriebssystem version string

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_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


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}}"

💡 TIPP: 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.


Häufig gestellte Fragen

  • 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.

Hat dies deine Frage beantwortet?