Skip to content

Commit ee53447

Browse files
author
Anze
committed
Rename Ping collector -> Ping bot
1 parent 8033fdb commit ee53447

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ deploy_to_docker_hub:
3333
- docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" -t "$CI_REGISTRY_IMAGE:latest" --build-arg VERSION=$CI_COMMIT_TAG --build-arg VCS_REF=$CI_COMMIT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') .
3434
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
3535
- docker push "$CI_REGISTRY_IMAGE:latest"
36-
- docker rmi grafolean/grafolean-collector-ping:$CI_COMMIT_TAG
37-
- docker rmi grafolean/grafolean-collector-ping:latest
36+
- docker rmi grafolean/grafolean-ping-bot:$CI_COMMIT_TAG
37+
- docker rmi grafolean/grafolean-ping-bot:latest
3838

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM python:3.6-slim-stretch as python-requirements
2-
COPY ./Pipfile ./Pipfile.lock /pingcollector/
3-
WORKDIR /pingcollector
2+
COPY ./Pipfile ./Pipfile.lock /pingbot/
3+
WORKDIR /pingbot
44
RUN \
55
pip install pipenv && \
66
pipenv lock -r > /requirements.txt
77

88
FROM python:3.6-slim-stretch as build-backend
9-
COPY ./ /pingcollector/
10-
WORKDIR /pingcollector
9+
COPY ./ /pingbot/
10+
WORKDIR /pingbot
1111
RUN \
1212
find ./ ! -name '*.py' -type f -exec rm '{}' ';' && \
1313
rm -rf tests/ .vscode/ .pytest_cache/ __pycache__/ && \
@@ -21,16 +21,16 @@ ARG VCS_REF
2121
ARG BUILD_DATE
2222
LABEL org.label-schema.vendor="Grafolean" \
2323
org.label-schema.url="https://grafolean.com/" \
24-
org.label-schema.name="Grafolean Ping Collector" \
25-
org.label-schema.description="Ping collector for Grafolean" \
24+
org.label-schema.name="Grafolean Ping bot" \
25+
org.label-schema.description="ICMP Ping bot for Grafolean" \
2626
org.label-schema.version=$VERSION \
27-
org.label-schema.vcs-url="https://gitlab.com/grafolean/grafolean-collector-ping/" \
27+
org.label-schema.vcs-url="https://github.com/grafolean/grafolean-ping-bot/" \
2828
org.label-schema.vcs-ref=$VCS_REF \
2929
org.label-schema.build-date=$BUILD_DATE \
3030
org.label-schema.docker.schema-version="1.0"
3131
COPY --from=python-requirements /requirements.txt /requirements.txt
3232
RUN pip install --no-cache-dir -r /requirements.txt
33-
COPY --from=build-backend /pingcollector/ /pingcollector/
34-
WORKDIR /pingcollector
33+
COPY --from=build-backend /pingbot/ /pingbot/
34+
WORKDIR /pingbot
3535
USER root
36-
CMD ["python", "-m", "pingcollector"]
36+
CMD ["python", "-m", "pingbot"]

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# About Grafolean Ping Collector
1+
# About Grafolean Ping bot
22

3-
This package is a Ping Collector for Grafolean, an easy to use generic monitoring system.
3+
This package is an ICMP Ping bot for Grafolean, an easy to use generic monitoring system.
44

55
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
6+
a single Ping bot instance can be fetching data for multiple accounts and entities. The fetching intervals can be specified with
77
up to a second precision.
88

99
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)
10+
- the devices will be pinged *from the container* (make sure Ping bot is installed in the correct network and that there are no firewalls in between)
1111
- Grafolean must be accessible via HTTP(S)
1212

1313
# License
1414

1515
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.
16+
share, but you can't sell it to third parties. See [LICENSE.md](https://github.com/grafolean/grafolean-ping-bot/blob/master/LICENSE.md) for details.
1717

18-
If in doubt, please [open an issue](https://gitlab.com/grafolean/grafolean-collector-ping/issues) to get further clarification.
18+
If in doubt, please [open an issue](https://github.com/grafolean/grafolean-ping-bot/issues) to get further clarification.
1919

2020
# Install (docker / docker-compose)
2121

2222
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.
2323

2424
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.
2525

26-
2) save [docker-compose.yml](https://gitlab.com/grafolean/grafolean-collector-ping/raw/master/docker-compose.yml) to a local file:
26+
2) save [docker-compose.yml](https://github.com/grafolean/grafolean-ping-bot/raw/master/docker-compose.yml) to a local file:
2727
```
28-
$ mkdir ~/pingcollector
29-
$ cd ~/pingcollector
30-
$ wget https://gitlab.com/grafolean/grafolean-collector-ping/raw/master/docker-compose.yml
28+
$ mkdir ~/pingbot
29+
$ cd ~/pingbot
30+
$ wget https://github.com/grafolean/grafolean-ping-bot/raw/master/docker-compose.yml
3131
```
3232
3333
3) These settings must be set:
@@ -38,13 +38,13 @@ Docker is the easiest and currently the only officially supported way. Note that
3838
3939
The easiest way to set them is to download example `.env` and edit it:
4040
```
41-
$ wget https://gitlab.com/grafolean/grafolean-collector-ping/raw/master/.env.example -O .env
41+
$ wget https://github.com/grafolean/grafolean-ping-bot/raw/master/.env.example -O .env
4242
$ nano .env
4343
```
4444
4545
4) run: `docker-compose up -d`
4646
47-
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`.
47+
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-ping-bot`.
4848
4949
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`).
5050
@@ -60,7 +60,7 @@ Upgrading should be easy:
6060
6161
Container logs can be checked by running:
6262
```
63-
$ docker logs --since 5m -f grafolean-collector-ping
63+
$ docker logs --since 5m -f grafolean-ping-bot
6464
```
6565
6666
## Building locally
@@ -80,4 +80,4 @@ To contribute to this repository, CLA needs to be signed. Please open an issue a
8080
8181
## Issues
8282
83-
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.
83+
If you encounter any problems installing or running the software, please let us know in the [issues](https://github.com/grafolean/grafolean-ping-bot/issues). Please make an effort when describing the issue. If we can reproduce the problem, we can also fix it much faster.

docker-compose.dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ services:
44
# Build a local Docker image. Usage:
55
# $ docker-compose -f docker-compose.dev.yml build
66

7-
grafolean-collector-ping:
8-
image: grafolean/grafolean-collector-ping
9-
container_name: grafolean-collector-ping
7+
grafolean-ping-bot:
8+
image: grafolean/grafolean-ping-bot
9+
container_name: grafolean-ping-bot
1010
build:
1111
context: .
1212
dockerfile: Dockerfile

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ services:
55
# BACKEND_URL=... # backend API base url (the part before "/api/...")
66
# BOT_TOKEN=... # bot token
77

8-
grafolean-collector-ping:
8+
grafolean-ping-bot:
99
# If you wish to load an explicit version, change the next line. For example:
10-
# image: grafolean/grafolean-collector-ping:v1.0.0
11-
image: grafolean/grafolean-collector-ping
12-
container_name: grafolean-collector-ping
10+
# image: grafolean/grafolean-ping-bot:v1.0.0
11+
image: grafolean/grafolean-ping-bot
12+
container_name: grafolean-ping-bot
1313
environment:
1414
# Backend url must be set to the address of the Grafolean backend, for example this uses Grafolean hosted service:
1515
# - BACKEND_URL=https://grafolean.com/api
1616
# IMPORTANT: '127.0.0.1' and 'localhost' are _never_ correct addresses for Grafolean backend, because they translate
1717
# to container, not host.
1818
- BACKEND_URL=${BACKEND_URL}
19-
# To use PING Collector, a bot with the protocol "ping" must be added via user interface, then the token needs to be copied here:
19+
# To use PING bot, a bot with the protocol "ping" must be added via user interface, then the token needs to be copied here:
2020
- BOT_TOKEN=${BOT_TOKEN}
2121
# Interval between fetching information about jobs:
2222
- JOBS_REFRESH_INTERVAL=${JOBS_REFRESH_INTERVAL:-60}

pingcollector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ def send_results_to_grafolean(backend_url, bot_token, account_id, values):
3737
log.exception("Error sending data to Grafolean")
3838

3939

40-
class PingCollector(Collector):
40+
class PingBot(Collector):
4141

4242
def jobs(self):
4343
for entity_info in self.fetch_job_configs('ping'):
4444
intervals = list(set([sensor_info["interval"] for sensor_info in entity_info["sensors"]]))
4545
job_info = { **entity_info, "backend_url": self.backend_url, "bot_token": self.bot_token }
4646
job_id = str(entity_info["entity_id"])
47-
yield job_id, intervals, PingCollector.do_ping, job_info
47+
yield job_id, intervals, PingBot.do_ping, job_info
4848

4949
@staticmethod
5050
def do_ping(*args, **job_info):
@@ -122,5 +122,5 @@ def wait_for_grafolean(backend_url):
122122
if not bot_token:
123123
raise Exception("Please specify BOT_TOKEN / BOT_TOKEN_FROM_FILE env var.")
124124

125-
c = PingCollector(backend_url, bot_token, jobs_refresh_interval)
125+
c = PingBot(backend_url, bot_token, jobs_refresh_interval)
126126
c.execute()

0 commit comments

Comments
 (0)