Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Service Status Script

This repository contains a python script that periodically runs a shell script to check service statuses and then displays the results via a local web server.

How It Works

The ServiceStatus.py script operates in an infinite loop with a 2-second interval. In each cycle, it performs the following actions:

  1. Executes Health Check: health-check.sh using subprocess.call(). This script performs the actual service health checks and generates an output file in JSON format.
  2. Serves Results: It then starts a local web server using the live-server command to serve the contents of the current directory, allowing you to view the results from the health check script in a browser.

Prerequisites

Before running this script, ensure you have the following installed and configured:

  • Python 3: The script is written in Python.
  • health-check.sh: You must create an executable shell script named health-check.sh in the same directory as ServiceStatus.py. This script should contain the logic for checking the status of your url domains.
  • live-server: This is a Node.js package. You can install it globally using npm:
    npm install -g live-server

Usage

  1. Clone the repository.
  2. Create your custom health-check.sh file in the root directory and make it executable:
    chmod +x health-check.sh
  3. Ensure all prerequisites are met.
  4. Run the Python script:
    python3 ServiceStatus.py

The script will start, execute health-check.sh, and then launch live-server. This process will repeat every two seconds. You can view the output by navigating to the URL provided by live-server in your terminal.

About

Automation Script to refresh log and publish new results

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages