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