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