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.7.tar.gz
(7.7 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.7.tar.gz.
File metadata
- Download URL: monit-agd-1.3.7.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b7b0b465e917b0fec4baf15ac3b9766261f0f6e24678743972defedd15a230
|
|
| MD5 |
ecde058a489edfd18af7367232c4b4a0
|
|
| BLAKE2b-256 |
26daaa676f3529d72e62aca51b070f878b027bd4bae33732723d679922ec3037
|
File details
Details for the file monit_agd-1.3.7-py3-none-any.whl.
File metadata
- Download URL: monit_agd-1.3.7-py3-none-any.whl
- Upload date:
- Size: 8.6 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 |
5e28aa25aa3e5acc3bbae7e8aca8fcfc8fee86eef357bcfb8055514c5ab1c6d5
|
|
| MD5 |
87385c087d54066001fcf46816cd1c3d
|
|
| BLAKE2b-256 |
6628a771b044047f88805284d71cc3685c8996d4917b905ca9b46eeb7fd36bf4
|