summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2013-07-29 19:08:55 +0200
committerroot <root@vm-monitoring.spline.inf.fu-berlin.de>2013-07-29 19:08:55 +0200
commitadef9502cb9562ceb63ad761abecde6bef8fdba4 (patch)
tree799928e9a854df1c9c5d92ee9a7e938da7f63b7e
parent8a3bc49cc9c17c7477aac14513111d02d5285bbe (diff)
downloadformat-notify-adef9502cb9562ceb63ad761abecde6bef8fdba4.tar.gz
format-notify-adef9502cb9562ceb63ad761abecde6bef8fdba4.tar.bz2
format-notify-adef9502cb9562ceb63ad761abecde6bef8fdba4.zip
log dropping messages to syslog
-rwxr-xr-xformat-notify3
1 files changed, 2 insertions, 1 deletions
diff --git a/format-notify b/format-notify
index f461190..a0114c7 100755
--- a/format-notify
+++ b/format-notify
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import os, sys, re, errno, time, random
+import os, sys, re, errno, time, random, syslog
def add_color(status):
if status == 'WARNING':
@@ -45,6 +45,7 @@ def main():
break
except OSError:
if time.time() - now > 2:
+ syslog.syslog("Dropping message: '%s'" % msg)
sys.exit(1)
else:
time.sleep(random.random() * 0.3)