Skip to content

Commit eedda1a

Browse files
author
Anze
committed
Rename collector -> bot
1 parent f847a96 commit eedda1a

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ deploy to docker hub:
3131
variables:
3232
- $CI_COMMIT_TAG =~ /^v[0-9]+[.][0-9]+[.][0-9]+([.][^.]+)?$/
3333
variables:
34-
CI_REGISTRY_IMAGE: grafolean/grafolean-collector-snmp
34+
CI_REGISTRY_IMAGE: grafolean/grafolean-snmp-bot
3535
script:
3636
- apk add --no-cache git
3737
# check that we are deploying the latest version:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ 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 SNMP Collector" \
25-
org.label-schema.description="SNMP collector for Grafolean" \
24+
org.label-schema.name="Grafolean SNMP bot" \
25+
org.label-schema.description="SNMP bot for Grafolean" \
2626
org.label-schema.version=$VERSION \
27-
org.label-schema.vcs-url="https://gitlab.com/grafolean/grafolean-collector-snmp/" \
27+
org.label-schema.vcs-url="https://github.com/grafolean/grafolean-snmp-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"

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# About Grafolean SNMP Collector
1+
# About Grafolean SNMP bot
22

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

55
Once installed, all the configuration of SNMP sensors is done through Grafolean's web-based user interface. Depending on permissions,
6-
a single SNMP Collector instance can be fetching data for multiple accounts and entities. The fetching intervals can be specified with
6+
a single SNMP 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
Under the hood it uses [net-snmp](http://net-snmp.sourceforge.net/) (via [easysnmp](https://easysnmp.readthedocs.io)), which means
1010
it should be compatible with any device that can respond to requests by `snmpget` and `snmpwalk`.
1111

1212
Requirements:
13-
- the devices that should be queried via SNMP must be accessible *from the container* (make sure SNMP Collector is installed in correct network and that there are no firewalls in between)
13+
- the devices that should be queried via SNMP must be accessible *from the container* (make sure that SNMP bot is installed in the correct network and that there are no firewalls in between)
1414
- Grafolean must be accessible via HTTP(S)
1515

1616
Current limitations:
@@ -21,21 +21,21 @@ Current limitations:
2121
# License
2222

2323
License is Commons Clause license (on top of Apache 2.0) - source is available, you can use it for free (commercially too), modify and
24-
share, but you can't sell it. See [LICENSE.md](https://gitlab.com/grafolean/grafolean-collector-snmp/blob/master/LICENSE.md) for details.
24+
share, but you can't sell it. See [LICENSE.md](https://github.com/grafolean/grafolean-snmp-bot/blob/master/LICENSE.md) for details.
2525

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

2828
# Install (docker / docker-compose)
2929

3030
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.
3131

3232
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 `SNMP`. Copy the bot token.
3333

34-
2) save [docker-compose.yml](https://gitlab.com/grafolean/grafolean-collector-snmp/raw/master/docker-compose.yml) to a local file:
34+
2) save [docker-compose.yml](https://github.com/grafolean/grafolean-snmp-bot/raw/master/docker-compose.yml) to a local file:
3535
```
3636
$ mkdir ~/snmpbot
3737
$ cd ~/snmpbot
38-
$ wget https://gitlab.com/grafolean/grafolean-collector-snmp/raw/master/docker-compose.yml
38+
$ wget https://github.com/grafolean/grafolean-snmp-bot/raw/master/docker-compose.yml
3939
```
4040
4141
3) edit `docker-compose.yml` and change:
@@ -46,7 +46,7 @@ Docker is the easiest and currently the only officially supported way. Note that
4646
4747
4) run: `docker-compose up -d`
4848
49-
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-snmp`.
49+
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-snmp-bot`.
5050
5151
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`).
5252
@@ -62,7 +62,7 @@ Upgrading should be easy:
6262
6363
Container logs can be checked by running:
6464
```
65-
$ docker logs --since 5m -f grafolean-collector-snmp
65+
$ docker logs --since 5m -f grafolean-snmp-bot
6666
```
6767
6868
## Building locally
@@ -82,4 +82,4 @@ To contribute to this repository, CLA needs to be signed. Please open an issue a
8282
8383
## Issues
8484
85-
If you encounter any problems installing or running the software, please let us know in the [issues](https://gitlab.com/grafolean/grafolean-collector-snmp/issues). Please make an effort when describing the issue. If we can reproduce the problem, we can also fix it much faster.
85+
If you encounter any problems installing or running the software, please let us know in the [issues](https://github.com/grafolean/grafolean-snmp-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.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ version: '2.1'
22
services:
33

44
#
5-
# Welcome to Grafolean SNMP Collector!
5+
# Welcome to Grafolean SNMP bot!
66
#
77
# This file should be modified to suit your running environment. Please check the comments and change
88
# the settings appropriately.
99
#
1010

1111
snmpbot:
1212
# If you wish to load an explicit version, change the next line. For example:
13-
# image: grafolean/grafolean-collector-snmp:v1.0.0
14-
image: grafolean/grafolean-collector-snmp
15-
container_name: grafolean-collector-snmp
13+
# image: grafolean/grafolean-snmp-bot:v1.0.0
14+
image: grafolean/grafolean-snmp-bot
15+
container_name: grafolean-snmp-bot
1616
environment:
1717
# Backend url must be set to the address of the Grafolean backend, for example this uses Grafolean hosted service:
1818
# - BACKEND_URL=https://grafolean.com/api
1919
# IMPORTANT: '127.0.0.1' and 'localhost' are _never_ correct addresses for Grafolean backend, because they translate
2020
# to container, not host.
2121
- BACKEND_URL=${BACKEND_URL}
22-
# To use SNMP Collector, a bot with the protocol "snmp" must be added via user interface, then the token needs to be copied here:
22+
# To use SNMP bot, a bot with the protocol "snmp" must be added via user interface, then the token needs to be copied here:
2323
- BOT_TOKEN=${BOT_TOKEN}
2424
# Interval between fetching information about jobs:
2525
- JOBS_REFRESH_INTERVAL=${JOBS_REFRESH_INTERVAL:-60}
@@ -31,7 +31,7 @@ services:
3131

3232
redis:
3333
image: redis:5-alpine
34-
container_name: grafolean-collector-snmp-redis
34+
container_name: grafolean-snmp-bot-redis
3535
restart: always
3636
networks:
3737
- grafolean
@@ -40,7 +40,7 @@ services:
4040
autoheal:
4141
# This container automatically restarts any container that fails its health check. Not a bullet-proof solution, but better than nothing.
4242
image: willfarrell/autoheal
43-
container_name: autoheal-snmp
43+
container_name: grafolean-snmp-bot-autoheal
4444
environment:
4545
- AUTOHEAL_CONTAINER_LABEL=all
4646
volumes:

snmpbot.py

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

195195

196-
class SNMPCollector(Collector):
196+
class SNMPBot(Collector):
197197

198198
@staticmethod
199199
def do_snmp(*args, **job_info):
@@ -310,7 +310,7 @@ def jobs(self):
310310
intervals = list(set([sensor_info["interval"] for sensor_info in entity_info["sensors"]]))
311311
job_info = { **entity_info, "backend_url": self.backend_url, "bot_token": self.bot_token }
312312
job_id = str(entity_info["entity_id"])
313-
yield job_id, intervals, SNMPCollector.do_snmp, job_info
313+
yield job_id, intervals, SNMPBot.do_snmp, job_info
314314

315315

316316
if __name__ == "__main__":
@@ -322,5 +322,5 @@ def jobs(self):
322322
raise Exception("Please specify BACKEND_URL and BOT_TOKEN env vars.")
323323
jobs_refresh_interval = int(os.environ.get('JOBS_REFRESH_INTERVAL', 120))
324324

325-
c = SNMPCollector(backend_url, bot_token, jobs_refresh_interval)
325+
c = SNMPBot(backend_url, bot_token, jobs_refresh_interval)
326326
c.execute()

0 commit comments

Comments
 (0)