Skip to main content
Every machine has an id that survives a reinstall and a label you can change.

Show the machine

Derivation tells you where the id comes from:
  • platform: derived from the computer’s own platform id (/etc/machine-id on Linux, the hardware UUID on macOS) and your user id. Reinstalling agentx on the same computer gives the same id.
  • random: generated once and kept in machine.json in agentx home, because the computer has no platform id or you reset the id.

Rename the machine

The label defaults to the hostname until you set it. agentx config set label does the same thing. A label is one non-empty line of at most 256 bytes with no control character in it.

Reset the id

Use this when two machines report the same id, for example after cloning a virtual machine. The new id is random and stays in use even though the platform id still exists. Delete machine.json in agentx home to go back to the platform-derived id.

Script it

Add --json to get a machine event with id, label and derivation:
rename and reset-id emit the same event with the new values. If another agentx command is running, both exit with code 7 at once; retry when it finishes.