Updated Monitor (markdown)

master
Petr Stefan 8 years ago
parent 9f79104463
commit 2cf7ffa202

@ -2,11 +2,12 @@
## Introduction ## Introduction
Monitor is part of ReCodEx solution for reporting progress of job evaluation back to user in real time. It gets progress notifications from broker and sends them through WebSockets to clients' browsers. For now, it's meant as an optional part of whole solution, but for full experince it's recommended to use one. Monitor is part of ReCodEx solution for reporting progress of job evaluation back to user in the real time. It gets progress notifications from broker and sends them through WebSockets to clients' browsers. For now, it's meant as an optional part of whole solution, but for full experince it's recommended to use one.
Monitor is one per broker, that is one per ReCodEx instance. Also, monitor has to be publicly visible (has to have public IP address) and also needs a connection to the broker. Monitor is one per broker, that is one per separate ReCodEx instance. Also, monitor has to be publicly visible (has to have public IP address) and also needs a connection to the broker.
## Basic info
## Architecture
Monitor is written in Python, tested versions are 3.4 and 3.5. For it's functionality following packages are required: Monitor is written in Python, tested versions are 3.4 and 3.5. For it's functionality following packages are required:
@ -16,8 +17,6 @@ Monitor is written in Python, tested versions are 3.4 and 3.5. For it's function
- pyyaml - parsing YAML configuration files - pyyaml - parsing YAML configuration files
- argparse - parsing command line arguments - argparse - parsing command line arguments
## Architecture
## Installation ## Installation
Installation will provide you with following files: Installation will provide you with following files:
@ -29,6 +28,8 @@ Installation will provide you with following files:
Systemd script runs monitor binary as specific _recodex_ user, so in `postinst` script user and group of this name are created. Also, ownership of configuration file will be granted to that user. Systemd script runs monitor binary as specific _recodex_ user, so in `postinst` script user and group of this name are created. Also, ownership of configuration file will be granted to that user.
Make sure to allow TCP connection to WebSocket address and port specified in configuration in your firewall. Otherwise, monitor won't work.
**Fedora (and other RPM distributions):** **Fedora (and other RPM distributions):**
@ -42,6 +43,38 @@ Systemd script runs monitor binary as specific _recodex_ user, so in `postinst`
## Configuration ## Configuration
Configuration file is located in subdirectory `monitor` of standard ReCodEx configuration folder `/etc/recodex/`. It's in YAML format as all of the other configurations. Format is very similar to configurations of broker or workers. Example configuration file is here:
```{.yml}
---
websocket_uri:
- "127.0.0.1"
- 4567
zeromq_uri:
- "127.0.0.1"
- 7894
logger:
file: "/var/log/recodex/monitor.log"
level: "debug"
max-size: 1048576 # 1 MB
rotations: 3
...
```
### Configuration items
- **websocket_uri** - URI where is the endpoint of websocket connection. Must be publicly visible!
- string representation of IP address or a hostname
- port number
- **zeromq_uri** - URI where is the endpoint of zeromq connection from broker. Could be hidden from public internet.
- string representation of IP address or a hostname
- port number
- **logger** - settings of logging
- **file** - path with name of log file. Defaults to `/var/log/recodex/monitor.log`
- **level** - logging level, one of "debug", "info", "warning", "error" and "critical"
- **max-size** - maximum size of log file before rotation in bytes
- **rotations** - number of rotations kept
## Usage ## Usage
Preferred way to start monitor as a service is via systemd as `sudo systemctl start recodex-monitor.service`. After that, check if application lauch was successful using `sudo systemctl status recodex-monitor.service`. Now you should see green **Active (running)**. Preferred way to start monitor as a service is via systemd as `sudo systemctl start recodex-monitor.service`. After that, check if application lauch was successful using `sudo systemctl status recodex-monitor.service`. Now you should see green **Active (running)**.

Loading…
Cancel
Save