Log Jasmin SMS Gateway MT/MO to MongoDB Cluster.
Project description
Jasmin Mongo Logger
Log Jasmin SMS Gateway's MT/MO to MongoDB Cluster (can be a one-node cluster).
Table of Contents
Installation Instructions
PYPI:
pip3 install -U jasmin-mongo-logger
From Source:
git clone https://github.com/BlackOrder/jasmin_mongo_logger.git
cd jasmin_mongo_logger
pip3 install .
Setup MongoDB CLuster
Docker
Prepare network:
docker network create mongo_cluster_subnet
Prepare variables:
cd docker
cp .env.example .env
Edit the .env
file. change the default username and password.
Create cluster key:
Mongo nodes need to share the same key to be able to authenticate each-other
One line:
echo "MONGODB_CLUSTER_KEY="$(openssl rand -base64 756 | sed -z 's/\n/\\n/g') >> .env
if the above failes to create the env variable in .env
file, you have to do it in multiple steps.
Manually
- Create key file:
openssl rand -base64 756 > mongo_cluster_key
- Edit Key:
vim ./mongo_cluster_key
replace all new-line with \n
- Step 3:
Create a variable in
.env
file and use the string fromStep 2
as it's value
MONGODB_CLUSTER_KEY=####-Single line encrypted key-####
Start MongoDB cluster service:
docker compose -f docker-compose.MongoCluster.yml up -d
Usage Instructions:
Jasmin Mongo Logger
Logs all MT/MO from jasmin
to MongoDB Cluster. All settings are read from OS ENV when run from console. if you want to import it in you code, you can supply the settings on initialization.
Data Structure
You have to supply a database and a collection name. The package will dump all data into the collection.
Start the service
Set variables
To start the package. you have to export the fallowing variables:
AMQP_BROKER_HOST = 127.0.0.1
AMQP_BROKER_PORT = 5672
MONGODB_CONNECTION_STRING = **REQUIRED:NoDefault**
MONGODB_LOGS_DATABASE = **REQUIRED:NoDefault**
MONGODB_LOGS_COLLECTION = **REQUIRED:NoDefault**
JASMIN_MONGO_CONFIGURATION_LOG_PATH = /var/log
Start Log-Reactor
jasminmongologd
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jasmin_mongo_logger-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7530d848a078b16e5aa0d4198018614a0f9457dfb2db16cba098a89165ddf68 |
|
MD5 | 97684302edf91aa84a24bd8415d661bf |
|
BLAKE2b-256 | 092218e238d8b1d6b271565cda61f81844ff19739702a6cad99583e3335e6b2c |
Hashes for jasmin_mongo_logger-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923e82fc50048ea9e495f6e7c2c0a9569bcc266364b7adf5d8b3bf8ad6fa1839 |
|
MD5 | 9f32c8d5a4cd520b52afd0922f0de8e2 |
|
BLAKE2b-256 | 08589c19604d045321cd0b63419ef9ae78a588cd626441971ae87349bc97533c |