Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Get the alarm log within one week (python | Oracle)

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

#-*-coding:UTF-8-*-

# author: Rui Zhang

# date: 2017-08-09

# email: sharpzhang_2008@126.com

Import datetime

Def time_check ():

Yesterday=datetime.datetime.now ()-datetime.timedelta (days=1)

# yesterday_wk=yesterday.strftime ('% a')

# yesterday_mh=yesterday.strftime ('% b')

# yesterday_dy=yesterday.strftime ('% d')

Yesterday_wmd=yesterday.strftime ('a b d')

Today=datetime.datetime.now ()

# today_wk=today.strftime ('% a')

# today_mh=today.strftime ('% b')

# today_dy=today.strftime ('% d')

Today_wmd=today.strftime ('a b d')

# argv1=yesterday_wmd

# argv2=today_wmd

Return yesterday_wmd,today_wmd

Def chk_db_log (time1,time2):

Count_1=0

Count_2=0

# with open ("D:/alert_test1.log") as f:

F = open ('DRU _ red _ alertalarm _ 1.logbook _ journal _ r')

A = f.readlines ()

For line in a:

Count_1=count_1+1

If time1 in line:

# print time

# print (count)

Break

Elif time2 in line:

Break

For line in a:

Count_2=count_2+1

If count_1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report