Menu

Tree [3605ab] master /
 History

HTTPS access


File Date Author Commit
 .gitignore 2024-09-04 Harry Suryapambagya Harry Suryapambagya [91346e] chore: add gitignore
 Dockerfile 2024-09-05 Tom De Vylder Tom De Vylder [63b631] Reduce Docker image size by using Python Alpine
 LICENSE 2024-09-03 Harry Suryapambagya Harry Suryapambagya [9f9490] Create LICENSE
 README.md 2024-09-07 Harry Suryapambagya Harry Suryapambagya [3605ab] Update README.md
 checks.yaml 2024-09-05 Harry Suryapambagya Harry Suryapambagya [c3bbfd] Update default checks.yaml
 history.html.theme 2024-09-04 Harry Suryapambagya Harry Suryapambagya [ee77a9] style: add github repo
 incidents.md 2024-09-03 Harry Suryapambagya Harry Suryapambagya [81bb89] feat: tinystatus is up
 index.html.theme 2024-09-04 Harry Suryapambagya Harry Suryapambagya [ee77a9] style: add github repo
 requirements.txt 2024-09-05 Tom De Vylder Tom De Vylder [9a55f2] Add missing dependency: python-dotenv
 tinystatus.py 2024-09-07 Harry Suryapambagya Harry Suryapambagya [39b821] Add default path HTML_OUTPUT_DIRECTORY

Read Me

TinyStatus

TinyStatus is a simple, customizable status page generator that allows you to monitor the status of various services and display them on a clean, responsive web page.

Check out an online demo https://status.harry.id

image

Features

  • Monitor HTTP endpoints, ping hosts, and check open ports
  • Responsive design for both status page and history page
  • Customizable service checks via YAML configuration
  • Incident history tracking
  • Automatic status updates at configurable intervals
  • The generated HTML is only 5KB in size

Prerequisites

  • Python 3.11 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository or download the source code:
    git clone https://github.com/harsxv/tinystatus.git cd tinystatus

  2. Install the required dependencies:
    pip install -r requirements.txt

Configuration

  1. Create a .env file in the project root and customize the variables:
    MONITOR_CONTINOUSLY=True CHECK_INTERVAL=30 MAX_HISTORY_ENTRIES=100 LOG_LEVEL=INFO CHECKS_FILE=checks.yaml INCIDENTS_FILE=incidents.md TEMPLATE_FILE=index.html.theme HISTORY_TEMPLATE_FILE=history.html.theme STATUS_HISTORY_FILE=history.json HTML_OUTPUT_DIRECTORY=/var/www/htdocs/status/

  2. Edit the checks.yaml file to add or modify the services you want to monitor. Example:
    ```yaml

  3. name: GitHub Home
    type: http
    host: https://github.com
    expected_code: 200

  4. name: Google DNS
    type: ping
    host: 8.8.8.8

  5. name: Database
    type: port
    host: db.example.com
    port: 5432
    ```

  6. (Optional) Customize the incidents.md file to add any known incidents or maintenance schedules.

  7. (Optional) Modify the index.html.theme and history.html.theme files to customize the look and feel of your status pages.

Usage

  1. Run the TinyStatus script:
    python tinystatus.py

  2. The script will generate two files:

  3. index.html: The main status page
  4. history.html: The status history page
  5. history.json: The status history and timestamp data

  6. To keep the status page continuously updated, you can run the script in the background:

  7. On Unix-like systems (Linux, macOS):
    nohup python tinystatus.py &
  8. On Windows, you can use the Task Scheduler to run the script at startup.

  9. Serve the generated HTML files using your preferred web server (e.g., Apache, Nginx, or a simple Python HTTP server for testing).

Using Docker

In order to run the script using Docker:

docker build -t tinystatus . docker run -ti --rm --name tinystatus -v "$PWD":/usr/src/myapp -w /usr/src/myapp tinystatus

Customization

  • Adjust the configuration variables in the .env file to customize the behavior of TinyStatus.
  • Customize the appearance of the status page by editing the CSS in index.html.theme and history.html.theme.
  • Add or remove services by modifying the checks.yaml file.

Porting TinyStatus

TinyStatus porting are available in:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open source and available under the MIT License.

MongoDB Logo MongoDB