|
| 1 | +# About Grafolean Ping Collector |
| 2 | + |
| 3 | +This package is a Ping Collector for Grafolean, an easy to use generic monitoring system. |
| 4 | + |
| 5 | +Once installed, all the configuration of Ping sensors is done through Grafolean's web-based user interface. Depending on permissions, |
| 6 | +a single Ping Collector instance can be fetching data for multiple accounts and entities. The fetching intervals can be specified with |
| 7 | +up to a second precision. |
| 8 | + |
| 9 | +Requirements: |
| 10 | +- the devices will be pinged *from the container* (make sure Ping Collector is installed in the correct network and that there are no firewalls in between) |
| 11 | +- Grafolean must be accessible via HTTP(S) |
| 12 | + |
| 13 | +# License |
| 14 | + |
| 15 | +License is Commons Clause license (on top of Apache 2.0) - source is available, you can use it for free (commercially too), modify and |
| 16 | +share, but you can't sell it to third parties. See [LICENSE.md](https://gitlab.com/grafolean/grafolean-collector-ping/blob/master/LICENSE.md) for details. |
| 17 | + |
| 18 | +If in doubt, please [open an issue](https://gitlab.com/grafolean/grafolean-collector-ping/issues) to get further clarification. |
| 19 | + |
| 20 | +# Install (docker / docker-compose) |
| 21 | + |
| 22 | +Docker is the easiest and currently the only officially supported way. Note that while instructions might (with possibly some modifications) work on other operating systems, Linux is assumed. |
| 23 | + |
| 24 | +1) log in to Grafolean service (either https://grafolean.com/ or self-hosted), select an appropriate `Account` and create a new `Bot`. Make sure that selected protocol is `Ping`. Copy the bot token. |
| 25 | + |
| 26 | +2) save [docker-compose.yml](https://gitlab.com/grafolean/grafolean-collector-ping/raw/master/docker-compose.yml) to a local file: |
| 27 | + ``` |
| 28 | + $ mkdir ~/pingcollector |
| 29 | + $ cd ~/pingcollector |
| 30 | + $ wget https://gitlab.com/grafolean/grafolean-collector-ping/raw/master/docker-compose.yml |
| 31 | + ``` |
| 32 | +
|
| 33 | +3) edit `docker-compose.yml` and change: |
| 34 | + - mandatory: `BACKEND_URL` (set to the URL of Grafolean backend, for example `https://grafolean.com/api`), |
| 35 | + - mandatory: `BOT_TOKEN` (set to the bot token from step 1), |
| 36 | + - optional: `JOBS_REFRESH_INTERVAL` (interval in seconds at which the jobs definitions will be updated) |
| 37 | + Alternatively, you can also copy `.env.example` to `.env` and change settings there (leaving `docker-compose.yml` in original state). |
| 38 | +
|
| 39 | +4) run: `docker-compose up -d` |
| 40 | +
|
| 41 | +If you get no error, congratulations! Everything else is done from within the Grafolean UI. You can however check the status of container as usually by running `docker ps`, and investigate logs by running `docker logs -f grafolean-collector-ping`. |
| 42 | +
|
| 43 | +In case of error make sure that the user is allowed to run `docker` (that is, that it is in `docker` group) by running `docker ps`. Alternatively, container can be run using `sudo` (line 4 then reads `sudo docker-compose up -d`). |
| 44 | +
|
| 45 | +## Upgrade |
| 46 | +
|
| 47 | +Upgrading should be easy: |
| 48 | +
|
| 49 | +1) `$ docker-compose pull` |
| 50 | +2) `$ docker-compose down` |
| 51 | +3) `$ docker-compose up -d` |
| 52 | +
|
| 53 | +## Debugging |
| 54 | +
|
| 55 | +Container logs can be checked by running: |
| 56 | +``` |
| 57 | +$ docker logs --since 5m -f grafolean-collector-ping |
| 58 | +``` |
| 59 | +
|
| 60 | +## Building locally |
| 61 | +
|
| 62 | +If you wish to build the Docker image locally (for debugging or for development purposes), you can specify a custom docker-compose YAML file: |
| 63 | +``` |
| 64 | +docker-compose -f docker-compose.dev.yml build |
| 65 | +``` |
| 66 | +
|
| 67 | +In this case `.env.example` can be copied to `.env` and all settings can be altered there, which helps us avoid commiting settings to the repository. |
| 68 | +
|
| 69 | +# Development |
| 70 | +
|
| 71 | +## Contributing |
| 72 | +
|
| 73 | +To contribute to this repository, CLA needs to be signed. Please open an issue about the problem you are facing before submitting a pull request. |
| 74 | +
|
| 75 | +## Issues |
| 76 | +
|
| 77 | +If you encounter any problems installing or running the software, please let us know in the [issues](https://gitlab.com/grafolean/grafolean-collector-ping/issues). Please make an effort when describing the issue. If we can reproduce the problem, we can also fix it much faster. |
0 commit comments