Skip to content

aztekmq/poiHC

Repository files navigation


POI Health Check

License: MIT

Overview

The POI Health Check is a Python-based utility designed to orchestrate health checks across multiple servers using customizable Point-Of-Interest (POI) scripts. This tool facilitates the collection, execution, and reporting of system health data from various server environments. It supports multi-threading, secure SSH execution, and integration with popular reporting tools like Confluence, Dynatrace, email, and LogScale (formerly SYSLOG).

Features

  • Automated Health Checks: Collect and execute health-check scripts on a list of servers, similar to Ansible.
  • Customizable Scripts: Use a sub-directory of customizable POI scripts that can be tailored for specific checks.
  • Multi-Threaded Execution: Leverage multiple threads to process a large list of servers efficiently.
  • Extensive Reporting: Output results in various formats and optionally push them to Confluence, Dynatrace, email, and SYSLOG.
  • Secure Operations: POI scripts are copied and executed on target servers, with a cleanup trap to ensure no residual files are left behind.

Installation

Prerequisites

  • Python 3.x
  • Required Python packages (can be installed via requirements.txt):
    • requests
    • configparser
    • argparse
    • concurrent.futures

Installation Steps

  1. Clone the Repository:

    git clone https://github.com/aztekmq/poiHC.git
    cd poiHC
  2. Install Required Packages:

    pip install -r requirements.txt
  3. Setup Configuration:

    • Configure the necessary settings in the config.ini files located under the config/single/ and config/rdqm/ directories.
    • Update the inventory_file to point to your list of target servers.

Usage

Command-Line Arguments

The script supports the following command-line arguments:

  • -t, --type: Required. Specifies the type of the MQ environment. Choose between single or rdqm.

Running the Health Check

To execute the health check, run the following command:

python3 poi-healthcheck.py -t <environment-type>

Example:

python3 poi-healthcheck.py -t single

Configuration

  • SSH Key: The script uses SSH for remote execution. Ensure that the ssh_key parameter in the configuration is correctly set to the path of your SSH private key.
  • Logging: Customize the logging configuration in the config.ini file, including log file location, log level, and log rotation size.
  • POI Scripts: Place your POI scripts in the appropriate directory (pois/single/ or pois/rdqm/).

Output

The results are stored in a JSON file named results.<type>.json, where <type> corresponds to the environment type (single or rdqm). The script can also generate an HTML report and push the results to Confluence, Dynatrace, email, or SYSLOG, depending on the configuration.

Example POI Script Structure

Your POI scripts should follow a specific structure and be placed in the pois/single/ or pois/rdqm/ directories. The script should output a status of ok or error, and provide details for further analysis.

Reporting

The health check results can be published to various platforms based on the configuration:

  • Confluence: Automatically update a Confluence page with the health check results and documentation.
  • Email: Send a detailed report via email to specified recipients.
  • SYSLOG: Log results to SYSLOG for centralized logging and monitoring.

Contributing

We welcome contributions to enhance the functionality and performance of the POI Health Check tool. To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

Please ensure that your code adheres to the project's coding standards and includes relevant tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For any inquiries or support, please contact the project maintainer at rob@aztekmq.net.


About

Collects multiple points of interest from several thousand RHEL servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors