Skip to content

MartinCanovas/omtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project omtools

This project contains a Python script to parse and print useful details from an Ops Manager Diagnostic Archive.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

You will need to have Python 3 and pip installed on your machine. You can download the latest version of Python from the official website: https://www.python.org/downloads/

Installing dependencies

To install the required packages, run the following command in your terminal:

$ pip install termcolor

Running the script

The script must be run in the directory where the Ops Manager Diagnostic Archive was uncompressed.

Example:

$ ls -l
drwx------@   6 user1  staff        192 Feb  8 13:45 63e26005a0405032cb78e171-diagnostics_2023-02-08_20_31_58Z
-rw-r--r--@   1 user1  staff    1175238 Feb  8 13:44 63e26005a0405032cb78e171-diagnostics_2023-02-08_20_31_58Z.tar.gz
$ cd 63e26005a0405032cb78e171-diagnostics_2023-02-08_20_31_58Z
$ omtools.py

The script can be run using the following command in your terminal:

$ omtools.py --help
usage: omtools.py [-h] [-info] [-v] [-host_mappings]
                  [-mms [-all | -error]]
                  [-monitoring [-all | -error] [-hostname HOSTNAME]]
                  [-automation [-all | -error] [-hostname HOSTNAME]]
                  [-backup [-all | -error] [-hostname HOSTNAME]]

optional arguments:
  -h, --help          Show this help message and exit
  -v, --version       Show program version and exit
  -info               Print general information about the Ops Manager deployment
  -host_mappings      Provide Host Mappings

  -mms                Check MMS logs
                      Use with -all or -error to control log output

  -monitoring         Check Monitoring logs
                      Optional: -hostname HOSTNAME
                      Optional: -all or -error

  -automation         Check Automation logs
                      Optional: -hostname HOSTNAME
                      Optional: -all or -error

  -backup             Check Backup logs
                      Optional: -hostname HOSTNAME
                      Optional: -all or -error

  -snapshot -s CLUSTER_NAME
                      Show last snapshots for the named cluster from snapshotHistory.json

  -all                Display all logs for the selected component
                      (must be used together with -mms, -monitoring,
                       -automation, or -backup)

  -error              Display only error logs for the selected component
                      (must be used together with -mms, -monitoring,
                       -automation, or -backup)

  -hostname HOSTNAME  Filter logs by hostname
                      (only valid with -monitoring, -automation, or -backup)

Examples

Valid combinations

View all Ops Manager logs:

$ omtools.py -all -mms

View only Ops Manager error logs:

$ omtools.py -error -mms

View all monitoring logs for all hosts:

$ omtools.py -all -monitoring

View only error monitoring logs for all hosts:

$ omtools.py -error -monitoring

View all automation logs for all hosts:

$ omtools.py -all -automation

View only error automation logs for all hosts:

$ omtools.py -error -automation

View all backup logs for all hosts:

$ omtools.py -all -backup

View only error backup logs for all hosts:

$ omtools.py -error -backup

View logs filtered by a specific hostname:

$ omtools.py -all -monitoring -hostname my-host-01
$ omtools.py -all -automation -hostname my-host-02
$ omtools.py -all -backup -hostname my-host-02

Snapshot history examples:

$ omtools.py -snapshot CRSMY
$ omtools.py -s CRSMYDR

Demo

Author

Martin Canovas

Contributor

ChatGPT

About

This is a Python script to parse MongoDB Ops Manager Diagnostic Archives

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages