This Python script performs a comprehensive health check for an OpenShift cluster, including key components such as CEPH, OpenShift Data Foundation (ODF), Single Sign-On (SSO), and 3scale API Management. It also gathers node resource usage, NTP status, MTU settings, storage utilization, and inter-node connectivity.
- CEPH Monitoring: Checks the status of the CEPH cluster using the
rook-ceph-operator
. - ODF Status: Lists the pods and their states in the
openshift-storage
namespace. - SSO and 3scale Status: Reports the pod states for
openshift-sso
and3scale
namespaces. - Cluster Info: Retrieves the cluster name and lists all nodes.
- MTU Verification: Checks MTU settings for all cluster nodes.
- Resource Monitoring: Displays CPU and memory usage for nodes.
- NTP Verification: Verifies time synchronization on all nodes.
- Inter-Node Connectivity: Checks connectivity between cluster nodes.
- Storage Utilization: Displays disk usage details.
- Python: Ensure Python 3.6+ is installed.
- OpenShift CLI (oc): The
oc
CLI tool must be installed and configured. - Access Permissions: The user running the script should have cluster admin privileges.
- Python Libraries: Install the following libraries:
pip install tabulate
Clone the repository or download the script.
Execute the script using Python:
python atp-cluster-report.py
The script generates a detailed health check report in a text file. The file is named in the format:
<cluster_name>_reporte_<timestamp>.txt
The report includes detailed tables with the status of each component and resource.
The report will include sections like:
- NTP Status: Time synchronization results for all nodes.
- CEPH Status: Health status of the CEPH cluster.
- MTU Settings: Details about the MTU on each node.
- Node Resources: CPU and memory usage for each node.
- ODF, SSO, and 3scale Status: Pod statuses for these components.
- Connectivity Tests: Ping results between nodes.
- Storage Utilization: Disk usage details.
- Namespaces: Update the namespaces for specific components in the script (
openshift-storage
,openshift-sso
,3scale
) if they differ in your setup. - Output Directory: Modify the
generar_reporte
function to specify a custom output directory.
- Command Errors: Ensure the
oc
CLI is configured properly and can connect to the cluster. - Permissions: Verify that the user has adequate permissions to execute debug commands and fetch cluster resources.
- Dependencies: Ensure all required Python libraries are installed.