import sys
from abstfilter import AbstractConsumer
import optparse
+import time
class Notifier(AbstractConsumer):
def __init__(self, usegrowl, usenotify, useprint):
zop = d['opcode'].lower()
zsender = d['sender'].lower()
zauth = d['auth'].lower() == 'yes'
- ztime = ':'.join(d['time'].split(' ')[3].split(':')[0:2])
+ ztime = "%02d:%02d" % time.strptime(d['time'])[3:5]
zmessage = d['message']
idtuple = (zclass, zinstance, zsender, ztime)
id = '%s/\n%s/\n%s\n %s' % idtuple
print (id, header)
print message
if self.usegrowl:
- growlnotify = ['growlnotify', '-a', 'MacZephyr', '-n', 'zephyr', '-d', id, '-t', header]
+ growlnotify = ['growlnotify', '-H', 'localhost', '-a', 'MacZephyr', '-n', 'zephyr', '-d', id, '-t', header]
g = subprocess.Popen(growlnotify, stdin=subprocess.PIPE)
g.stdin.write(message)
g.stdin.close()
return 1
if ssh is not None:
- command = "ssh -K %s 'tzc -si'" % ssh
+ command = "ssh -o GSSAPIAuthentication=yes -o GSSAPIDelegateCredentials=yes -o GSSAPIKeyExchange=yes %s 'tzc -si'" % ssh
else:
command = "tzc -si"
p = os.popen(command)