How to tell if a command is "stuck" using the amagent log
If you suspect that there may be a stuck command on your device, the easiest way to confirm this would be to dive into the amagent.log. Although it may look scary, essentially you're just looking for behavior that looks like:
2022/09/15 13:39:59 cmd.go:194: Executing command: 7917317685 has been running for 1h45m0.1035288s
2022/09/15 13:44:59 cmd.go:194: Executing command: 7917317685 has been running for 1h50m0.1073909s
2022/09/15 13:49:59 cmd.go:194: Executing command: 7917317685 has been running for 1h55m0.1138937s
2022/09/15 13:54:59 cmd.go:194: Executing command: 7917317685 has been running for 2h0m0.1144911s
2022/09/15 14:00:00 cmd.go:194: Executing command: 7917317685 has been running for 2h5m0.1238763s
2022/09/15 14:05:00 cmd.go:194: Executing command: 7917317685 has been running for 2h10m0.1296283s
2022/09/15 14:10:00 cmd.go:194: Executing command: 7917317685 has been running for 2h15m0.1429522s
2022/09/15 14:15:00 cmd.go:194: Executing command: 7917317685 has been running for 2h20m0.1486846s
2022/09/15 14:20:00 cmd.go:194: Executing command: 7917317685 has been running for 2h25m0.1627982s
You can see that there is a command number, and the timestamp is on the left side. In this instance, we can see that it's been running for 2 hours and 25 minutes. This doesn't always find if there is a stuck command, but it's one way to tell if you are suspecting a command is stuck.
Commands will have a response sent noted (the lack of this causes the "stuck" condition).
Long running commands may not always be an issue, but should be looked into as to what is running long. If customers are uncertain as to why a command is running long, or what the command is running, they should contact support.