-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge branch 'CDOT-CV:develop' into develop"
- Loading branch information
1 parent
00aea6c
commit 7847621
Showing
65 changed files
with
613 additions
and
1,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
resources/sql_scripts/update_scripts/snmp_credentials_update.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.12.0-alpine3.18 | ||
|
||
WORKDIR /home | ||
|
||
ADD addons/images/rsu_ping/crontab.rsu_ping_fetch ./crontab | ||
ADD addons/images/rsu_ping/requirements.txt . | ||
ADD addons/images/rsu_ping/rsu_ping_fetch.py . | ||
ADD addons/images/rsu_ping/purger.py . | ||
ADD common/*.py ./common/ | ||
|
||
RUN pip3 install -r requirements.txt | ||
# fix the line endings from windows | ||
RUN dos2unix /home/crontab | ||
|
||
RUN crontab /home/crontab | ||
|
||
CMD ["crond", "-f"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.12.0-alpine3.18 | ||
|
||
WORKDIR /home | ||
|
||
ADD addons/images/rsu_ping/crontab.rsu_pinger ./crontab | ||
ADD addons/images/rsu_ping/requirements.txt . | ||
ADD addons/images/rsu_ping/rsu_pinger.py . | ||
ADD addons/images/rsu_ping/purger.py . | ||
ADD common/*.py ./common/ | ||
|
||
RUN pip3 install -r requirements.txt | ||
# fix the line endings from windows | ||
RUN dos2unix /home/crontab | ||
|
||
RUN crontab /home/crontab | ||
|
||
CMD ["crond", "-f"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# RSU Ping Services | ||
|
||
## Table of Contents | ||
|
||
- [RSU Ping Services](#rsu-ping-services) | ||
- [Table of Contents](#table-of-contents) | ||
- [About ](#about-) | ||
- [Requirements ](#requirements-) | ||
- [rsu_ping_fetch](#rsu_ping_fetch) | ||
- [rsu_pinger](#rsu_pinger) | ||
|
||
## About <a name = "about"></a> | ||
|
||
This directory contains two microservices that run within the CV Manager GKE Cluster. Both the 'rsu_ping_fetch' and 'rsu_pinger' applications populate the CV Manager PostGreSQL database's 'ping' table with the current online statuses of all RSUs recorded in the 'rsus' table. For 'rsu_ping_fetch', these statuses are retrieved directly from a [Zabbix server](https://www.zabbix.com/). For 'rsu_pinger', these statuses are generated by pinging every RSU in the 'rsus' table every 1 minute. | ||
|
||
If you have access to a Zabbix server that is tracking RSUs, it is recommended to use the 'rsu_ping_fetch' application. However, the 'rsu_pinger' is an effective alternative. | ||
|
||
Another feature both applications provide is a ping data purger that will remove stale ping data from the CV Manager PostgreSQL database to allow for high performance RSU ping queries. The amount of time a message needs to be in the database to be considered stale is configurable with the STALE_PERIOD environment variable. This purger will run once every 24 hours to check for stale ping data in the database. | ||
|
||
## Requirements <a name = "requirements"></a> | ||
|
||
### rsu_ping_fetch | ||
|
||
To properly run the rsu_ping_fetch microservice the following services are also required: | ||
|
||
- CV Manager PostgreSQL database with at least one RSU inserted into the 'rsus' table | ||
- Zabbix server with the REST API enabled | ||
- rsu_ping_fetch must be deployed in the same environment or K8s cluster as the PostgreSQL database | ||
- Network rules must be in place to allow proper routing between the rsu_ping_fetch microservice and the Zabbix server | ||
|
||
The rsu_ping_fetch microservice expects the following environment variables to be set: | ||
|
||
- ZABBIX_ENDPOINT - Zabbix API access endpoint. | ||
- ZABBIX_USER - Zabbix API access username. | ||
- ZABBIX_PASSWORD - Zabbix API access password. | ||
- DB_USER - PostgreSQL access username. | ||
- DB_PASS - PostgreSQL access password. | ||
- DB_NAME - PostgreSQL database name. | ||
- DB_HOST - PostgreSQL hostname, make sure to include port number. | ||
- STALE_PERIOD - Number of hours a ping log needs to be around in the PostgreSQL database to be considered stale. | ||
- LOGGING_LEVEL (optional, defaults to 'info') | ||
|
||
### rsu_pinger | ||
|
||
To properly run the rsu_pinger microservice the following services are also required: | ||
|
||
- CV Manager PostgreSQL database with at least one RSU inserted into the 'rsus' table | ||
- rsu_pinger must be deployed in the same environment or K8s cluster as the PostgreSQL database | ||
- Network rules must be in place to allow proper routing between the rsu_pinger microservice and deployed RSUs | ||
|
||
The rsu_pinger microservice expects the following environment variables to be set: | ||
|
||
- DB_USER - PostgreSQL access username. | ||
- DB_PASS - PostgreSQL access password. | ||
- DB_NAME - PostgreSQL database name. | ||
- DB_HOST - PostgreSQL hostname, make sure to include port number. | ||
- STALE_PERIOD - Number of hours a ping log needs to be around in the PostgreSQL database to be considered stale. | ||
- LOGGING_LEVEL (optional, defaults to 'info') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PYTHONPATH=/home | ||
*/1 * * * * /usr/local/bin/python3 /home/rsu_ping_fetch.py | ||
0 0 * * * /usr/local/bin/python3 /home/purger.py |
8 changes: 3 additions & 5 deletions
8
...es/addons/images/rsu_status_check/crontab → ...addons/images/rsu_ping/crontab.rsu_pinger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
PYTHONPATH=/home | ||
* * * * * /usr/local/bin/python3 /home/rsu_ping_fetch.py | ||
* * * * * /usr/local/bin/python3 /home/rsu_pinger.py | ||
0 0 * * * /usr/local/bin/python3 /home/purger.py | ||
0 */4 * * * /usr/local/bin/python3 /home/rsu_snmp_fetch.py | ||
PYTHONPATH=/home | ||
* * * * * /usr/local/bin/python3 /home/rsu_pinger.py | ||
0 0 * * * /usr/local/bin/python3 /home/purger.py |
Oops, something went wrong.