Skip to content

Commit

Permalink
Base documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
romanov committed Sep 7, 2022
1 parent 80fcc49 commit 2ad4816
Show file tree
Hide file tree
Showing 8 changed files with 738 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Building docs
run: mkdocs gh-deploy --force
63 changes: 63 additions & 0 deletions docs/configuration/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Examples

## Typical full config file

```yaml
Server:
bind_address: '0.0.0.0'
port: 8800
refresh_time: 2

Global:
unit: 'ms'

Local:
src_addr: '0.0.0.0'
timeout: 1
ttl: 64
size: 56

Devices:
- name: 'RT_1'
type: 'cisco'
transport: 'telnet'
address: '192.168.0.1'
username: 'user'
password: 'password'
port: 23
- name: 'RT_2'
type: 'juniper'
transport: 'ssh'
address: '192.168.0.9'
username: 'user'
password: 'password'
port: 22


Policies:
- name: mypolicy
max_rtt: 0.9

ServicesGroups:
- name: mygroup
device: 'RT_1'
services:
- name: serv1
target: '10.26.6.3'
delay: 3
policy: mypolicy
- name: serv2
target: '10.26.6.9'
delay: 8

Services:
- name: 'service01'
device: 'simplesla-local'
target: '192.168.0.24'
delay: 16
- name: 'service02'
device: 'RT_2'
target: '16.2.6.9'
delay: 5
policy: mypolicy
```
111 changes: 111 additions & 0 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All configuration options defined in one YAML file, ex `config.yaml`, that has s

## *Server*

Settings for a HTTP server of Prometheus endpoint

```yaml
Server:
bind_address: '0.0.0.0'
Expand All @@ -17,17 +19,126 @@ Server:
**`refresh_time`** (seconds) - Time of updating data in prometheus endpoint. This is independent from collectors of these metrics

## *Global*

Global settings for metric collectors

```yaml
Global:
unit: 'ms'
```
**`unit`** - Unit of Round-Trip-Time (RTT) in collected metrics

## *Local*

Settings of `simplesla-local` device for ICMP checks

```yaml
Local:
src_addr: '0.0.0.0'
timeout: 1
ttl: 64
size: 56
```
**`src_addr`** - Source address for ICMP requests from SimpleSLA

**`timeout`** (seconds) - Timeout for ICMP requests

**`ttl`** - TTL for outgoing packets

**`size`** (bytes) - Payload size of ICMP packets

## *Devices*

List of registered devices

```yaml
Devices:
- name: 'my_device'
type: 'cisco'
transport: 'ssh'
address: '192.168.0.1'
username: 'user'
password: 'password'
port: 22
```
**`name`** - Unique name of device, using in metric`s labels

**`type`** - Type of device, see full list of supported devices [here](../supported_devices.md)

**`transport`** - protocol to connect to the device, `ssh` and `telnet` are supported now

**`address`** - IPv4 or DSN of the device

**`username`** - Username to login to the device

**`password`** - Password for the account

**`port`** - Port number for connection

## *Policies*

List of policies to define status of service

```yaml
Policies:
- name: mypolicy
max_rtt: 0.15
```

**`name`** - Unique name of the policy

**`max_rtt`** - Max value of RTT to change service status

## *Services*

List of single services for metric collection

```yaml
Services:
- name: 'my_service01'
device: 'simplesla-local'
target: '192.168.0.10'
delay: 3
policy: mypolicy
- name: 'my_service02'
device: 'my_device'
target: '10.35.45.91'
delay: 7
```

**`name`** - Unique name of the service, using on metric`s labels

**`device`** - Name of the source device. Device MUST be defined in [Devices](index.md#devices) section

**`target`** - IPv4 or DSN as a destionation for checks

**`delay`** (seconds) - Pause between checking sessions

**`policy`** (*OPTIONAL*) - If using, MUST be defined in [Policies](index.md#policies) section

## *ServicesGroups*

```yaml
ServicesGroups:
- name: mygroup
device: 'my_device'
delay: 3
policy: mypolicy
services:
- name: serv1
target: '10.71.206.2'
policy: mypolicy
- name: serv2
target: '10.71.206.75'
delay: 3
```

**`name`** - Unique name of service group

**`device`** - Device for all sub services

**`delay`** (seconds) - Delay for all sub services

**`policy`** - Policy for all sub services

**`services`** - List of sub services. `delay` and `policy` can be overwritten
22 changes: 22 additions & 0 deletions docs/how_it_works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# How it works

![Schema](img/simplesla.svg)

SimpleSLA can handle ICMP checks and provide them to Prometheus with HTTP exporter. There are two ways to collect metrics:
* Local device
* Remote device

## Local device
SimpleSLA creates local device by default and without any need to define it through config file. Local device has default name **`simplesla-local`** and that\`s the ability to ping with ICMP packets right from the server or local PC with deployed SimpleSLA

Configuration of `simplesla-local` are described [here](configuration/index.md#local)

## Remote device
SimpleSLA can connect to other devices and collect RTT to some destinations, that cannot be reachable right from SimpleSLA.

These some steps of check algorithm:
1. Connect to device
2. Send `ping` command in appropriate format
3. Recieve raw output
4. Parse raw output to some value
5. Push the value as a metric in `Metric collector`
1 change: 1 addition & 0 deletions docs/img/grafana.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/img/prometheus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2ad4816

Please sign in to comment.