# luzik@pld-linux.org, 2007-03 - added digest auth method(jabber.gda.pl)
# arekm@pld-linux.org, 2009-07 - added fallback accounts support
# usage:
-# jabber.alert [-x] [-a account_id][,otheraccount_id] [-t timeout ] [-J from_jid -P password] to_jid1 to_jid2 to_jid3
+# jabber.alert [-x] [-c config] [-a account_id][,otheraccount_id] [-t timeout ] [-J from_jid -P password] to_jid1 to_jid2 to_jid3
import os
import hashlib
from pyxmpp.streamtls import TLSSettings
try:
- opts, args = getopt.getopt(sys.argv[1:], "J:P:a:dt:x")
+ opts, args = getopt.getopt(sys.argv[1:], "J:P:a:c:dt:x")
except getopt.GetoptError, e:
print >> sys.stderr, "%s: %s " % (sys.argv[0], e)
sys.exit(1)
html = False
debug = False
timeout = 20
-
+cfg = "/etc/nagios/jabber-notify.ini"
tjid = None
for o, a in opts:
if o == '-d':
import ConfigParser
config = ConfigParser.ConfigParser()
- config.read('/etc/nagios/jabber-notify.ini')
+ config.read(cfg)
for section in a.split(','):
jids.append({ 'jid': config.get(section, 'jid'), 'password': config.get(section, 'password')})