Skip to main content

A tool to perform multiple tasks (which I have not yet thought about but currently only to view logs) related to Amazon SSM agent via the command line.

Project description

SSM ADMIN CLI TOOL

ssm-admin logs

A tool to perform multiple tasks (which I have not yet thought about but currently only to view logs) related to Amazon SSM agent via the command line.

WHY?

Because I am lazy. I do not want to spend time trying to cd into the correct directory or type a loooooooooooonnnnnnnnnnnggggg directory path only to view a log file.

INSTALLATION

Make sure you have Python3.7 or higher installed on your system.

Switch to root user and then just use $ pip install ssm-admin or $pip3 install ssm-admin (if you are using a macbook).

HOW TO USE?

Within The Instance

The intention of this tool is that you can either view the logs right on the instance or you can download the logs to a different machine and use the tool to view them. All the information can be viewed using the --help option. Example:

# ssm-admin --help
# ssm-admin command-logs --help

The tool currently consists of 3 commands. They are as follows:

  1. agent-logs: This is to view the ssm agent logs.
  2. command-logs: This is to view the logs of SSM Command Invocations. It takes an argument command-id. Currently, this only supports logs from Run-Command and Patch operations.
  3. list-commands: This will output a table of command IDs and their respective time of creation. The latest command invocation will be at the top.

Outside The Instance

If you have collected the ssm related logs and downloaded them to your local machine for further investigation, then you can use the option --log-dir for all the sub-commands mentioned above.

  1. agent-logs: The path specified must be the path to a directory which contains amazon-ssm-agent.log file.
  2. command-logs: The path specified must be path to a directory which contains the orchestration directory
  3. list-commands: The path specified must be path to a directory which contains the orchestration directory

ROADMAP

This is very basic. Does not do much. However, there are lot of features that I am planning to add and you too can contribute:

  1. Implement time contraint to view the agent logs. Currently, the tools simply opens the latest agent log file. All the past log files should be combined and then we should be able to view the agent logs only withing a specified time frame.
  2. Implement log filtering so that we can only view logs that are ERROR or WARNING
  3. Add a new command to enable debug logs for the agent. Example: $ ssm-admin enable-debug should modify the seelog.xml file and restart the ssm agent.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssm_admin-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssm_admin-0.2.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file ssm_admin-0.2.0.tar.gz.

File metadata

  • Download URL: ssm_admin-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for ssm_admin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 52670d037c45fa8ed4d232348e228883d6f7bf85cfbd536c091ed7c984562ed8
MD5 ab930b1cf0d5cf432a570d10be55754d
BLAKE2b-256 5bec2bcd74b3f693b4fc602c849d4398b6f6a51f687f19983cefb6101b4f7232

See more details on using hashes here.

File details

Details for the file ssm_admin-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ssm_admin-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for ssm_admin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab3ce676d19a79c7a290614a3f18049b0fcb8755b1e69ceb75c891eb4f72a313
MD5 37d911bc5bb0eee539c62243c85d76cc
BLAKE2b-256 b2f19bcaef04cc44c12994821d32c2e0a9553f69b8eb5a3ad29ef13f1466c75d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page