Please describe the scenario where the new feature would be useful
A customer requested to know when a machine was onboarded to Ubuntu Pro for troubleshooting purposes. This would also be useful for support to easily determine the pro attachment history of a machine.
Describe the solution you'd like
Ideally a file like /var/lib/ubuntu-advantage/attachment.json
but persistent and append only that shows the attach/detach time of a machine. something like
cat /var/lib/ubuntu-advantage/attachment_history.json
{"attached_at": "2024-06-13T23:14:30.054382+00:00"}
{"detached_at": "2024-06-13T23:15:30.054382+00:00"}
{"attached_at": "2024-06-13T23:15:35.054382+00:00"}
etc.
Current behavior
The current behaviour is that /var/lib/ubuntu-advantage/attachment.json is removed after a pro detach. The history can be extracted from /var/log/ubuntu-advantage.log with sudo grep "Executed with sys.argv: \['/usr/bin/pro', 'attach'" /var/log/ubuntu-advantage.log but it's not ideal or friendly to troubleshooting/easily seeing the history of a machine.
Additional context
I'm happy to try to write the code/pull-request for this, if pointed in the right direction and this is deemed a worthwhile addition
Please describe the scenario where the new feature would be useful
A customer requested to know when a machine was onboarded to Ubuntu Pro for troubleshooting purposes. This would also be useful for support to easily determine the pro attachment history of a machine.
Describe the solution you'd like
Ideally a file like /var/lib/ubuntu-advantage/attachment.json
but persistent and append only that shows the attach/detach time of a machine. something like
Current behavior
The current behaviour is that /var/lib/ubuntu-advantage/attachment.json is removed after a
pro detach
. The history can be extracted from /var/log/ubuntu-advantage.log withsudo grep "Executed with sys.argv: \['/usr/bin/pro', 'attach'" /var/log/ubuntu-advantage.log
but it's not ideal or friendly to troubleshooting/easily seeing the history of a machine.Additional context
I'm happy to try to write the code/pull-request for this, if pointed in the right direction and this is deemed a worthwhile addition