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
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.1.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.1.tar.gz.
File metadata
- Download URL: monit-agd-1.3.1.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 |
372346f509caaf809f93490432b816e3c4c61960bd3b9f73cf79ec7161bfa420
|
|
| MD5 |
7d318568e3ea5a0c5988e8a02be40de0
|
|
| BLAKE2b-256 |
07a70b93f26c7ee2340c90215ad3a56e01f039b95a2de7007ac7019363fe4051
|
File details
Details for the file monit_agd-1.3.1-py3-none-any.whl.
File metadata
- Download URL: monit_agd-1.3.1-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 |
571cf2c8c9aa88d32b5a1acc4d87b8350ee0d80308d100bfd3821ecef495279f
|
|
| MD5 |
22332982e9f668bd0a82a21ef00bb486
|
|
| BLAKE2b-256 |
efa893e5be14995b4f34edd87b6d7baa39e8bd3278375bc09335051a7006aa4b
|