ats-monitoring-1.4.0 is not a library.
ATS Monitoring
Application for monitoring and reporting of engineering systems, sending notifications via Telegram-bot, API SMS gateway
Prerequisites outside docker
- Install Rust for Linux or macOS
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
For Windows, visit this page
- Install dependencies
# Ubuntu
$ sudo apt-get install libssl-dev build-essential
# Fedora
$ sudo dnf openssl-devel
- Install PostgreSQL
Initial setup
- Clone the repository
$ git clone https://github.com/stepanov-denis/ats-monitoring.git
- Edit your sms gateway authentication string in .cargo/config.toml
GATEWAY_STR_CONNECTION= "URI with your token"
- Edit your alert messages text in .cargo/config.toml
# For example:
# Alert messages for sms gateway
# The text of the SMS-message about the generator operation error
SMS_GEN_WORK_ERR = "your message"
# For example:
# Alert messages for Telegram-bot
# The text of the Telegram-message about the generator operation error
TG_GEN_WORK_ERR = "your message"
- Edit the connection configuration to PostgreSQL in .cargo/config.toml
POSTGRES_USERNAME = "postgres"
POSTGRES_PASSWORD = "mysecretpassword"
POSTGRES_DB = "postgres"
POSTGRES_HOSTNAME = "postgresql"
POSTGRES_PORT = "5432"
Setting up the environment
- Install SMLogix
- Upload into PLC Pixel file "ats control.psl"
- Upload into PLC Trim5 file "winter garden.psl"
- Install Orange Data Mining
- Сonfigure data reading from SQL database
- Create an account on ClickSend and top up your balance
- Run PLC Pixel
- Run PLC Trim5
Run app locally
- Run PostgreSQL
- Run Skytable
$ cd skytable && cargo run --bin skyd --release
- Run ATS Monitoring
$ cd ats-monitoring && cargo run --release
- For run ATS Monitoring with env_logger
$ RUST_LOG=error cargo run --release
$ RUST_LOG=warn cargo run --release
$ RUST_LOG=info cargo run --release
$ RUST_LOG=debug cargo run --release
$ RUST_LOG=trace cargo run --release
- For write log's to file
$ RUST_LOG=debug cargo run --release > log.txt
Run app in docker locally
- Run app, postgresql, skyd in the background
$ docker compose up -d
- Tear it all down
$ docker compose down
- Tear it all down with removing volumes
$ docker compose down --volumes
Use
- Сreate and save the report in the form you need in Orange Data Mining
- Check your phone for SMS messages from ClickSend
- Enjoy Ats Monitoring Bot