Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cardinate/subsquid-checkmk
https://github.com/cardinate/subsquid-checkmk
checkmk subsquid
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cardinate/subsquid-checkmk
- Owner: cardinate
- License: mit
- Created: 2024-03-28T17:44:26.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-28T18:06:37.000Z (8 months ago)
- Last Synced: 2024-03-28T19:29:46.188Z (7 months ago)
- Topics: checkmk, subsquid
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Subsquid Worker CheckMK Monitoring Plugin
This plugin allows you to monitor Subsquid workers via the enterprise IT monitoring platform [CheckMK](https://checkmk.com/). It works using the [piggyback mechanism](https://docs.checkmk.com/latest/en/piggyback.html). This means that the plugin is installed on a central monitoring host and centrally gathers data for all deployed workers.
## Installation
First, ensure that you have installed the necessary distribution packages to create Python virtualenvs. For example, on Ubuntu, that would be:
```sh
sudo apt install python3-pip python3-venv
```Clone the git repository, create a virtualenv and copy the script into a place where it will be found by the check_mk agent:
```sh
git clone https://github.com/cardinate/subsquid-checkmk.git
cd subsquid-checkmk
sudo python3 -m venv /usr/local/lib/check-subsquid-worker/
sudo /usr/local/lib/check-subsquid-worker/bin/pip install -r requirements.txt
sudo cp check-subsquid-worker /usr/lib/check_mk_agent/local/check-subsquid-worker
sudo chmod a+x /usr/lib/check_mk_agent/local/check-subsquid-worker
```## Configuration
For each worker that you monitor, you create a file in `/var/lib/check-subsquid-worker` (create this directory if it does not exist). The file name must be equal to the hostname in CheckMK, and the content must be the public key/P2P address of the (`12D3…`) worker's RPC node.
Additionally, you can create a file `/etc/default/check-subsquid-worker` to configure the following environment variables that affect the behaviour of the check.
| Variable | Meaning | Default |
|----------|---------|---------|
| `SUBSQUID_WORKERS_DIR` | The directory where the worker configuration files are found | `/var/lib/check-subsquid-worker` |
| `SUBSQUID_PING_TIMEOUT` | Timeout for retrieving basic data via the ping endpoint | `30` |
| `SUBSQUID_CHUNKS_TIMEOUT` | Timeout for retrieving chunk allocations | `30`
| `SUBQSUID_METRICS_TIMEOUT` | Timeout for retrieving additional per-worker metrics | `30`## Known issues and limitations
* The plugin works by scraping Subsquid's monitoring endpoints, which an be rather slow to respond. Consider using a rather large interval between checks to prevent issues.
* Traffic metrics (`responseBytes`) are currently not returned from the metrics endpoint.