More ssm-cli commands
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
Currently `ssm-cli` has following commands available:
- get-diagnostics
- get-instance-information
- get-offline-command-invocation
- send-offline-command
`get-diagnostics` is very helpful during troubleshooting. Similarly, I believe the `ssm-cli` can be extended with new commands to further make troubleshooting easy. Because currently, reviewing the logs (in linux) requires traversing a long list of directories: `/var/lib/amazon/ssm//document/orchestration//....` and for its the same for agent-logs: `/var/log/amazon/ssm/amazon-ssm-agent.log`
Hence, I propose the following commands:
- `ssm-cli get-cmds`: This lists all the commands in the directory `../document/orchestration/` in descending order of time of execution. Example: `Command ID - Document - Timestamp`
- `ssm-cli cmd-logs `: Opens the `stdout` file of the specific command id
- `ssm-cli agent-logs -s 00:00 -e 10:00`: Displays the agent logs specifically for the start-time `-s` and end-time `-e`.
- `ssm-cli agent-config KEY=VALUE`: This helps easily change the agent's configuration like log-level, `RunCommandLogsRetentionDurationHours`, `AssociationLogsRetentionDurationHours`, etc.
- `ssm-cli get-cmds -f`: Also the `-f` flag for specifying the folder that contains the command logs which will help when we are troubleshooting the logs from another managed server.
I had previously written my own tool in python called [ssm-admin](https://github.com/hashrr/ssm-admin). I believe it would be more useful for users to troubleshoot when it comes compiled along with the ssm-agent.
I am interested in implementing this as well😊.
Contributor guide
Research direction
Start by reading the existing ssm-cli commands and the log locations under /var/lib/amazon/ssm//document/orchestration/ and /var/log/amazon/ssm/amazon-ssm-agent.log. Compare the proposed behavior with the referenced ssm-admin tool, then clarify the command scope and acceptance criteria; done should mean the agreed troubleshooting commands work when compiled with the agent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, python
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100