]> git.pld-linux.org Git - packages/nagios-alert-jabber.git/commitdiff
- allow body in parameters
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 7 Jan 2017 11:36:16 +0000 (12:36 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 7 Jan 2017 11:36:16 +0000 (12:36 +0100)
nagios-jabber.alert

index 7deaaa472d9b3a1cb8449cc438e2104aec73d049..106a96e277308c0d0adb6f12bbd49421fad6ee44 100644 (file)
@@ -38,7 +38,10 @@ debug = False
 timeout = 20
 cfg = "/etc/nagios/jabber-notify.ini"
 tjid = None
+body = ""
 for o, a in opts:
+    if o == '-b':
+        body = a
     if o == '-c':
         cfg = a
     if o == '-d':
@@ -84,13 +87,12 @@ if debug:
 
 subject = "Nagios alert"
 
-body = ""
-stdin_body = ""
-do_print = True
-for line in sys.stdin.readlines():
-    stdin_body += line
+if not body:
+    stdin_body = ""
+    for line in sys.stdin.readlines():
+        stdin_body += line
 
-body += stdin_body
+    body += stdin_body
 
 if len(body.strip()) == 0:
     body = "(nagios-jabber.alert warning: missing message body)";
This page took 0.15879 seconds and 4 git commands to generate.