Skip to content

Commit

Permalink
Improved logic for timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Schoechlin committed Dec 13, 2017
1 parent 7562841 commit cfc8938
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions extension-files/tools/zabbix_check_dmesg
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ while True:

lines += 1
current_time_stamp = float(m.group("timestamp"))

if latest_time_stamp > current_time_stamp:
latest_time_stamp = current_time_stamp

msg = m.group("msg")

if current_time_stamp > latest_time_stamp:
Expand All @@ -84,10 +88,7 @@ while True:
sys.stderr.write("%s : %s : %s\n" % (EXECUTABLE, ident, line_str))
matched.append("%s/%s" % (ident, current_time_stamp))

if current_time_stamp < latest_time_stamp:
status_data["timestamp"] = current_time_stamp
else:
status_data["timestamp"] = latest_time_stamp
status_data["timestamp"] = latest_time_stamp

if len(matched) == 0:
matched.append("ALL OK (%s)" % latest_time_stamp)
Expand Down

0 comments on commit cfc8938

Please sign in to comment.