[packages/nagios-alert-jabber] - allow body in parameters

arekm arekm at pld-linux.org
Sat Jan 7 12:36:22 CET 2017


commit abcee6c0c5cfec5e76eb2154f2749048e6b335cc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Jan 7 12:36:16 2017 +0100

    - allow body in parameters

 nagios-jabber.alert | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/nagios-jabber.alert b/nagios-jabber.alert
index 7deaaa4..106a96e 100644
--- a/nagios-jabber.alert
+++ b/nagios-jabber.alert
@@ -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)";
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-alert-jabber.git/commitdiff/abcee6c0c5cfec5e76eb2154f2749048e6b335cc



More information about the pld-cvs-commit mailing list