mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
improved documentation for docker (#247)
This commit is contained in:
@@ -58,6 +58,7 @@ Read the documentation below for more options.
|
||||
- [Process/Uptime monitoring](docs/process-monitors.md)
|
||||
- [Notification user groups](docs/usergroups.md)
|
||||
- [HTTP/HTTPS proxy](docs/http-proxy.md)
|
||||
- [Update to latest version](docs/update.md)
|
||||
- [More information for developers](docs/develop.md)
|
||||
- [All npm commands](docs/develop.md#all-npm-commands)
|
||||
- [Git flow](docs/release-process.md#git-flow)
|
||||
|
@@ -66,29 +66,56 @@ There are two main builds:
|
||||
* `latest` stable version for production monitoring;
|
||||
* `dev` reflects the last commit in the `dev` branch. Use this only for development purposes.
|
||||
|
||||
Additionally, each release has its own build in case you want to revet back to an older version.
|
||||
Additionally, each release has its own build in case you want to revert back to an older version.
|
||||
|
||||
To run the latest stable version of BGPalerter in Docker in interactive mode, do:
|
||||
To run the latest stable version of BGPalerter in Docker, do:
|
||||
|
||||
```
|
||||
docker run -i --name bgpalerter \
|
||||
-v $(pwd)/volume:/opt/bgpalerter/volume \
|
||||
nttgin/bgpalerter:latest run serve -- --d /opt/bgpalerter/volume
|
||||
```
|
||||
|
||||
With this command, a new directory `./volume` will be created in the current position.
|
||||
Such directory will contain all the persistent data that BGPalerter will generate, including configuration and alert logs.
|
||||
You can specify another directory by changing the directory before the colon in the -v flag (e.g. `-v _LOCATION_YOU_WANT_/volume:/opt/bgpalerter/volume`).
|
||||
|
||||
The command above runs BGPalerter in interactive mode (`-i` flag), which is necessary if you want to run the auto configuration.
|
||||
|
||||
You should replace the flag `-i` with the flag `-d`, when:
|
||||
* You already have the configuration files `config.yml` and `prefixes.yml`, or you plan to create them by hand. Just place them into the volume directory.
|
||||
* You executed BGPalerter with the `-i` flag and the volume directory and the configuration files have been already generated.
|
||||
|
||||
For production monitoring we suggest to monitor the uptime of BGPalerter.
|
||||
In case you want to monitor the uptime by using the `uptimeApi` ([read more](process-monitors.md)), you need to map the port in the docker configuration with the following command:
|
||||
|
||||
```bash
|
||||
docker pull nttgin/bgpalerter:latest
|
||||
docker run -i nttgin/bgpalerter
|
||||
docker run -i --name bgpalerter \
|
||||
-v $(pwd)/volume:/opt/bgpalerter/volume \
|
||||
-p 8011:8011
|
||||
nttgin/bgpalerter:latest run serve -- --d /opt/bgpalerter/volume
|
||||
```
|
||||
|
||||
To run the latest stable version of BGPalerter in docker in the background (`-d`) with
|
||||
pre-generated configuration files:
|
||||
The `uptimeApi` module has to be enabled in `volume/config.yml` as described [here](process-monitors.md).
|
||||
Now you can monitor `http://127.0.0.1:8011/status` (e.g. in Nagios) to check the status of the BGPalerter monitoring.
|
||||
Such API may return a negative result when there is a misconfiguration or when BGPalerter failed to connect to the data repository.
|
||||
|
||||
```
|
||||
docker run -d --name bgpalerter \
|
||||
-v $PWD/prefixes.yml:/opt/bgpalerter/prefixes.yml \
|
||||
-v $PWD/config.yml:/opt/bgpalerter/config.yml \
|
||||
|
||||
|
||||
Optionally, you can specify a health check in docker to auto-restart the container in case of prolonged failure.
|
||||
|
||||
```bash
|
||||
docker run -i --name bgpalerter \
|
||||
-v $(pwd)/volume:/opt/bgpalerter/volume \
|
||||
--health-cmd='wget --quiet --tries=1 --spider http://127.0.0.1:8011/status || exit 1' \
|
||||
--health-timeout=2s \
|
||||
--health-retries=12 \
|
||||
--health-interval=5s \
|
||||
--health-retries=15 \
|
||||
--health-interval=60s \
|
||||
--restart unless-stopped \
|
||||
-p 8011:8011 \
|
||||
nttgin/bgpalerter:latest
|
||||
-p 8011:8011
|
||||
nttgin/bgpalerter:latest run serve -- --d /opt/bgpalerter/volume
|
||||
```
|
||||
|
||||
The above example assumes the `uptimeApi` is enabled and listening on tcp 8011.
|
||||
> This option does NOT replace [proper monitoring](process-monitors.md).
|
||||
Just restarting the container will not assure you that the monitoring is working properly or that it will work again. You should always investigate failures and fix possible misconfiguration.
|
||||
|
||||
|
@@ -3,4 +3,5 @@
|
||||
BGPalerter can be easily updated. The configuration of BGPalerter is persisted in `config.yml` and `prefixes.yml`, as long as you preserve such files you will not need to reconfigure it after the update.
|
||||
|
||||
* if you are using the binary, go in the [releases tab](https://github.com/nttgin/BGPalerter/releases), download the new binary and replace the old one.
|
||||
* if you are using the source code, simply do a git pull of the master branch.
|
||||
* if you are using the source code, simply do a git pull of the master branch.
|
||||
* if you are using docker, do `docker pull nttgin/bgpalerter:latest`, after stop and remove your current container and [run it again](installation.md#running-bgpalerter-in-docker).
|
2
package-lock.json
generated
2
package-lock.json
generated
@@ -6096,7 +6096,7 @@
|
||||
},
|
||||
"radix-trie-js": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/radix-trie-js/-/radix-trie-js-1.0.5.tgz",
|
||||
"resolved": "http://apps.ip.gin.ntt.net:4873/radix-trie-js/-/radix-trie-js-1.0.5.tgz",
|
||||
"integrity": "sha512-3Olqy+P8cM5G2x+mnhD231bRM8c2uxAyU7uLS/dORgwzmr2CJKhT6DeQGqZyjsfWuqCYeX415xlMr1J6Xt7M9Q=="
|
||||
},
|
||||
"range-parser": {
|
||||
|
Reference in New Issue
Block a user