Hi, i have a bug when sending a pager alert and field contains the character )
==================zenactions.log ====================================
2007-09-27 16:57:53 WARNING zen.ZenActions: SELECT
clear.device,clear.component,clear.message,clear.firstTime,clear.summary,clear.severity
FROM history clear, history event WHERE clear.evid = event.clearid AND
event.evid = '0aecfab335d77336fffff6d'
2007-09-27 16:57:53 ERROR zen.ZenActions: action:jabber
Traceback (most recent call last):
File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 217, in processRules
self.processEvent(zem, ar, actfunc)
File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 287, in processEvent
action(context, data, True)
File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 447, in sendPage
msg = fmt % data
ValueError: unsupported format character ')' (0x29) at index 70
=====================================================================
i had to change my
check_nt -H myserver -p 1248 -v USEDDISKSPACE -l F -w 70 -c 90
to
check_nt -H myserver -p 1248 -v USEDDISKSPACE -l F -w 70 -c 90 | tr -d ')'
===============my sendPage in Products/ZenUtils/Utils.py===========
def sendPage(recipient, msg, snppHost, snppPort):
''' Send a page. Return a tuple: (success, message) where
sucess is True or False.
'''
import Pager,xmpp
try:
#rcpt = Pager.Recipient(recipient)
#pmsg = Pager.Message(msg)
#page = Pager.Pager((rcpt,), pmsg, snppHost, snppPort)
#page.send()
class Response:
def __init__(self, seed, text):
self.seed=seed
self.text=text
jidparams={}
if os.access('/etc/jabber.cfg',os.R_OK):
for ln in open('/etc/jabber.cfg').readlines():
key,val=ln.strip().split('=',1)
jidparams[key.lower()]=val
for mandatory in ['jid','password']:
if mandatory not in jidparams.keys():
open('/etc/jabber.cfg','w').write('[EMAIL PROTECTED]')
sys.exit(0)
jid=xmpp.JID(jidparams['jid'])
cl=xmpp.Client(jid.getDomain(),debug=[])
cl.connect()
cl.auth(jid.getNode(),jidparams['password'])
cl.send(xmpp.protocol.Message(recipient,msg))
cl.disconnect()
return (True,'')
except socket.error:
# Need to figure out what exceptions might be thrown above
# and explicitly catch them here.
result = (False, '%s - %s' % tuple(sys.exc_info()[:2]))
else:
result = (True, '')
return result
===============================================
------------------------
Attilio Drei
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=11165#11165
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users