Ok I removed the alert and started again and it seems to have fixed the 
issue... however once I edit the message it quickly comes back - think I need 
some help on how to format the messgaes so that they work with our SMS provider 
(clickatell).  I need to get the message to give the following output (with '+' 
signs in place of spaces in the 'text:' field as shown


> user:[email protected]
> password:mypasswd
> api_id:39876
> to: 447078456879
> text:Device:earth.mydomain.co.uk+Severity:Error+Time:2009/06/30+23:08:01.000+Message:Unable+to+read+processes+on+device+earth.mydomain.co.uk
> 


I tried using this code to achieve this in the message body but it is failing 
with MYSQL errors according to the actions log - doesn't seem to like the + 
signs


Code:
user:[email protected]
password:mypasswd
api_id:39876
to: 447078456879
text:Device:%(device)s+Severity:%(severityString)s+Time:%(firstTime)s+Message:%(message)s



error log showing:


> 2009-06-30 23:09:17 WARNING zen.ZenActions: SELECT 
> device,device)sSeverity:%(severityString)sTime:%(firstTime)sMessage:%(message,summary,severity,summary,
>  evid FROM status WHERE (prodState = 1000) and (eventState = 0) and (severity 
> >= 4) AND evid NOT IN  (SELECT evid FROM alert_state   WHERE userid='admin' 
> AND rule='stuartrules' )
> 2009-06-30 23:09:17 ERROR zen.ZenActions: action:stuartrules
> Traceback (most recent call last):
>   File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 237, in 
> processRules
>     self.processEvent(zem, ar, actfunc)
>   File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 263, in 
> processEvent
>     for result in self.query(q):
>   File "/opt/zenoss/Products/ZenEvents/zenactions.py", line 199, in query
>     curs.execute(stmt)
>   File "/opt/zenoss/lib/python/MySQLdb/cursors.py", line 137, in execute
>     self.errorhandler(self, exc, value)
>   File "/opt/zenoss/lib/python/MySQLdb/connections.py", line 33, in 
> defaulterrorhandler
>     raise errorclass, errorvalue
> ProgrammingError: (1064, "You have an error in your SQL syntax; check the 
> manual that corresponds to your MySQL server version for the right syntax to 
> use near 
> ')sSeverity:%(severityString)sTime:%(firstTime)sMessage:%(message,summary,severit'
>  at line 1")
> 





-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=36506#36506

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to