Commit 0b1de333 by zhangwei

修改输出

zabbix触发器按输出值判断
parent c8db9588
...@@ -37,8 +37,10 @@ def action(interval): ...@@ -37,8 +37,10 @@ def action(interval):
if __name__ == '__main__': if __name__ == '__main__':
user_info={} user_info={}
count=0
dbname="summer_hill" dbname="summer_hill"
d=db.openMysql(host,port,user,password,dbname) d=db.openMysql(host,port,user,password,dbname)
#sql='''select id,product_id,user_id,state,ctime,mtime from summer_hill.order where state='new';'''
sql='''select id,product_id,user_id,state,ctime,mtime from summer_hill.order where state='closed';''' sql='''select id,product_id,user_id,state,ctime,mtime from summer_hill.order where state='closed';'''
c=d.cursor() c=d.cursor()
c.execute(sql) c.execute(sql)
...@@ -46,9 +48,11 @@ if __name__ == '__main__': ...@@ -46,9 +48,11 @@ if __name__ == '__main__':
d.close() d.close()
if len(rs) > 0: if len(rs) > 0:
for line in rs: for line in rs:
print("[product_id]:%s,[user_id]:%s,[state]:%s") % (line[1],line[2],line[3]) #print("[product_id]:%s,[user_id]:%s,[state]:%s") % (line[1],line[2],line[3])
interval=get_interval(line[4]) interval=get_interval(line[4])
action(interval) count = count +1
else: #action(interval)
interval=0 print(count)
action(interval) # else:
\ No newline at end of file # interval=0
# action(interval)
\ No newline at end of file
#!/bin/bash #!/bin/bash
cd /opt/neo/script/cms_log/ cd /data/script/zabbix/
#(nginx php book video-center user-center summer-hill) #(nginx php book video-center user-center summer-hill)
/usr/bin/python cms_check_log.py $1 /usr/bin/python cms_check_log.py $1
#!/bin/bash #!/bin/bash
cd /opt/neo/script/cms_log/ cd /data/script/zabbix/
#name=(book books go sks userc users videocs) #name=(book books go sks userc users videocs)
/usr/bin/python cms_log.py --type $1 /usr/bin/python cms_log.py --type $1
#!/bin/bash
cd /data/script/zabbix/
/usr/bin/python check_pay_failure.py
\ No newline at end of file
#!/bin/bash
cd /data/script/zabbix/
/usr/bin/python check_pay_stat.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment