发布时间:2019-06-25 09:57:28编辑:auto阅读(2160)
1.connect
def conn(ip,user,password,database):
con = mdb.connect(ip,user,password,database)
cur = con.cursor()
return cur
2.select
SELECT ip,env from hosts ORDER BY 1, 2
for row in cur.fetchall():
print row
('172.x.x.x', 'prod')
('PROBLEM: 172.x.x.x Table open cache too small\r\nservice_name: Table open cache too small\r\nService_status: PROBLEM\r\nService_severity: Information\r\nItem values:\r\nCheck_service_ip:172.x.x.x\r\nCheck_service_name:mysql.status[Open_tables]\r\nCheck_service_vlaue:4059\r\nCheck_service_time:2018.03.01 09:54:43',)
3.update
上一篇: python 学习笔记 7 -- Pyt
下一篇: h3c路由器ssh配置
50460
49752
40348
37376
31796
28658
27588
22377
22370
20676
441°
1052°
846°
789°
1038°
911°
1525°
2861°
2559°
1962°