推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Uang
V2EX  ›  Python

Python 查询数据库数据发送监控预警邮件

  •  
  •   Uang · Sep 26, 2022 · 2384 views
    This topic created in 1352 days ago, the information mentioned may be changed or developed.
    想写一个脚本实现执行 mysql 语句,查询出相关数据,判断数据是否正常,如果不正常发送预警邮件到邮箱。
    请问有什么办法可以实现嘛?
    目前已经解决 ssh 连接数据库,获取游标成功并执行 sql 语句查出相关数据,还差判断执行发送邮件预警这部分。
    F281M6Dh8DXpD1g2
        1
    F281M6Dh8DXpD1g2  
       Sep 26, 2022
    这有啥不能实现的?
    连数据库读数据判断一下不就完了
    Uang
        2
    Uang  
    OP
       Sep 26, 2022
    @liprais 请问有相关的案例或者第三方库推荐嘛? 没有写过定时脚本,目前是个新手
    F281M6Dh8DXpD1g2
        3
    F281M6Dh8DXpD1g2  
       Sep 26, 2022
    @Uang 定时用 crontab 呗,剩下的你不是已经实现了
    Uang
        4
    Uang  
    OP
       Sep 26, 2022
    @liprais 好的非常感谢,我已经基本理清思路了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3418 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 10:52 · PVG 18:52 · LAX 03:52 · JFK 06:52
    ♥ Do have faith in what you're doing.