Programa de monitoramento de código python, desenvolvido para ser utilizado pelas funcionário da Agência de dados
Project description
Monit
Instalação:
pip install monit-agd
Exemplo arquivo .env:
# Project info
# Informações obrigatórias
PROJECT=sample_project
COMPANY=acme
LOCATION=ec2
DEV=coder
# Database info
# Informações obrigatórias
DB_USER=user
DB_PASSWORD=p@ssw0rd
DB_HOST=localhost
DB_DATABASE=teste
# Email info
# Deixe em branco para desativar o envio de e-mails
EMAIL=
EMAIL_PASSWORD=
Exemplo de Uso:
Maneira mais simples de usar o Monit
import time
from monit.core import Monitor as monit
from monit.error import SetupError
def main():
try:
time.sleep(5)
raise ValueError("This is a sample error.")
except Exception as e:
print("Erro: Ocorreu um erro inesperado.")
monit.notify_and_exit(SetupError, e)
if __name__ == "__main__":
main()
Registrar múltiplos erros
# sample.py
import time
from monit.core import Monitor
from monit.error import SetupError
# from monit.logger import Logger
# from monit.log2file import Log2File
def main():
# Initialize the Monitor
monit = Monitor()
# Log2File()
# log = Logger()
try:
# Your code that might raise exceptions
time.sleep(5)
raise ValueError("This is a sample error.")
except Exception as e:
print("Erro: Ocorreu um erro inesperado.")
monit.notify(SetupError, e)
# monit.notify_and_exit(SetupError, e)
monit.end()
if __name__ == "__main__":
main()
Tipos de erros:
SetupError
DatabaseError
HTTPError
FileError
FolderError
TooManyRequests
DataCreateError
DataUpdateError
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
monit-agd-1.3.4.tar.gz
(7.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file monit-agd-1.3.4.tar.gz.
File metadata
- Download URL: monit-agd-1.3.4.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ab78a034884d9a388fe5e107c8dfd3651590a2c64edc9aa51e00380a6ffc15
|
|
| MD5 |
57aab76f5e3b33334b3b22cfb69a5d7e
|
|
| BLAKE2b-256 |
cead76bc01196ca3a907b9458669ff87cc6003fd1de13c4e2392657a16c76129
|
File details
Details for the file monit_agd-1.3.4-py3-none-any.whl.
File metadata
- Download URL: monit_agd-1.3.4-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56509bc107d5a79c3e8ffabff0a8a3fafd8ffd5cc4c9a5bb46a752fa94dabfb6
|
|
| MD5 |
48e0b481c5afad43b2cf6d7c2cb0f4c9
|
|
| BLAKE2b-256 |
21eeadb9b4545db5e215610bb241df01930d9ff32482bee5dd4b62f140922910
|