A comprehensive monitoring tool for OpenSearch clusters that provides detailed analysis of cluster health, performance, and configuration. The tool generates an HTML report with insights about your OpenSearch cluster, including Logz.io integration for log analysis.
- Cluster Health Analysis
- Shard Allocation Analysis
- Index Settings Analysis
- Query Performance Analysis
- Index Mapping Analysis
- AWS Resource Alignment Analysis (for AWS OpenSearch domains)
- Logz.io Integration for Log Analysis
- HTML Report Generation with Progress Tracking
- Python 3.8 or higher
- pip (Python package installer)
- Access to an OpenSearch cluster
- (Optional) AWS credentials for AWS OpenSearch domains
- (Optional) Logz.io API token for log analysis
- Clone the repository:
git clone https://github.com/yourusername/opensearch_monitor.git
cd opensearch_monitor
- Install the required dependencies:
pip install -r requirements.txt
To run the monitor with basic OpenSearch connection:
python main.py --host your-opensearch-host --port 9200
If your OpenSearch cluster requires authentication:
python main.py --host your-opensearch-host --port 9200 --username your-username --password your-password
For AWS OpenSearch domains, include AWS credentials and domain name:
python main.py --host your-opensearch-host --port 9200 \
--region us-east-1 \
--access_key your-aws-access-key \
--secret_key your-aws-secret-key \
--domain your-opensearch-domain
To include Logz.io log analysis in the report:
python main.py --host your-opensearch-host --port 9200 \
--logz-api-token your-logz-api-token
A complete example with all options:
python main.py \
--host your-opensearch-host \
--port 9200 \
--region us-east-1 \
--access_key your-aws-access-key \
--secret_key your-aws-secret-key \
--domain your-opensearch-domain \
--username your-username \
--password your-password \
--logz-api-token your-logz-api-token \
--no-ssl
Argument | Description | Required | Default |
---|---|---|---|
--host |
OpenSearch endpoint host | Yes | - |
--port |
OpenSearch endpoint port | No | 443 |
--region |
AWS region (for AWS OpenSearch) | No | - |
--access_key |
AWS access key ID | No | - |
--secret_key |
AWS secret access key | No | - |
--domain |
OpenSearch domain name | No | - |
--username |
OpenSearch username | No | - |
--password |
OpenSearch password | No | - |
--logz-api-token |
Logz.io API token | No | - |
--no-ssl |
Disable SSL | No | SSL enabled |
The tool generates an HTML report (opensearch_report.html
) that includes:
- Cluster Health Status
- Shard Allocation Analysis
- Index Settings Analysis
- Query Performance Metrics
- Index Mapping Analysis
- AWS Resource Alignment (if applicable)
- Logz.io Log Analysis (if API token provided)
The report includes a progress bar showing the current stage of the monitoring process.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
For support, please open an issue in the GitHub repository.