Hi all, i'm again working on my script of parsing logfiles :) I putted a new function to disable the rule of error between a certain hours, cause i want to use it as a monitoring script that run every 5 minutes and to disable error in hours of maintenance. But i have some "problems" to check it. In the rule-file i have HHMM(start) and HHMM(stop) ----- 0 0 to disable hours check (i can't check the timestamp in logfile cause not all the logfiles that i need to check have a timestamp in it). In the script i wrote:
Actualtime=datetime.datetime.today().strftime("%H%M") if (start>end): if (Actualtime>start): end=int(Hcheck)+1 else: if (int(Actualtime)<int(end)): start=Actualtime if ((int(Actualtime)<int(start)) or (int(Actualtime)>int(end)) or ((start=="0") and (end=="0")) ): rule=error ...blablabla.... else: rule=skip ....blablabla.... Why i don't use the complete date with YYMMDDHHMM? Think about a rule that need to be disabled from hours 20:00 to 04:00. If i use also yymmdd, in the rule file i need to write a 2000 and 0400+1, the +1 to tell the script that the end is in the day after, to add a day. But it will work just till the 0000, hour in witch the day will change. The script work, but is not so "clean"....i just would like some advice to make it more clean, if possible. Like always, thanks in advance for the helps :) -- http://mail.python.org/mailman/listinfo/python-list