[packages/nagios-alert-jabber] - allow setting custom subject
arekm
arekm at pld-linux.org
Sat Jan 7 12:42:00 CET 2017
commit dcc2b4ebc7ffcdb40294b1a01049cb12ae71cc1a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Jan 7 12:41:53 2017 +0100
- allow setting custom subject
nagios-jabber.alert | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/nagios-jabber.alert b/nagios-jabber.alert
index 106a96e..83e09fd 100644
--- a/nagios-jabber.alert
+++ b/nagios-jabber.alert
@@ -27,7 +27,7 @@ from pyxmpp.jabber.client import JabberClient
from pyxmpp.streamtls import TLSSettings
try:
- opts, args = getopt.getopt(sys.argv[1:], "J:P:a:b:c:dt:x")
+ opts, args = getopt.getopt(sys.argv[1:], "J:P:a:b:c:ds:t:x")
except getopt.GetoptError, e:
print >> sys.stderr, "%s: %s " % (sys.argv[0], e)
sys.exit(1)
@@ -39,6 +39,7 @@ timeout = 20
cfg = "/etc/nagios/jabber-notify.ini"
tjid = None
body = ""
+subject = "Nagios alert"
for o, a in opts:
if o == '-b':
body = a
@@ -54,6 +55,8 @@ for o, a in opts:
tjid = a
if o == '-P':
jids.append({ 'jid': tjid, 'password': a })
+ if o == '-s':
+ subject = a
if o == '-a':
import ConfigParser
@@ -85,8 +88,6 @@ if debug:
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
-subject = "Nagios alert"
-
if not body:
stdin_body = ""
for line in sys.stdin.readlines():
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nagios-alert-jabber.git/commitdiff/dcc2b4ebc7ffcdb40294b1a01049cb12ae71cc1a
More information about the pld-cvs-commit
mailing list