Changes between Version 5 and Version 6 of GENIMonitoring/Alerts
- Timestamp:
- 05/12/15 17:05:42 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIMonitoring/Alerts
v5 v6 26 26 ==== Esper query format ==== 27 27 28 In a typical database we query existing data based on some declarative language. We can think of and Esper query like an upside down SQL, where if events occur in the future, results will be emitted. The Using the ESPER query language, ''EPL'' (similar to SQL) complex events can are described. 28 In a typical database we query existing data based on some declarative language. We can think of and Esper query like an upside down SQL, where if events occur in the future, results will be emitted. The Using the ESPER query language, ''EPL'' (similar to SQL) complex events can are described. The EPL language reference and examples can be found here: [[http://esper.sourceforge.net/esper-0.7.5/doc/reference/en/html/EQL.html]] 29 29 30 30 Consider the following EPL query: … … 76 76 ==== Example GENI monitoring stream queries ==== 77 77 78 Note how the following data types are used in the example queries. 79 80 {{ 81 ... 82 String urn; 83 String metric; 84 long ts; 85 double value; 86 ... 87 }} 88 * If metric ''gpo:is_available'' is set to ''1'' emit ''OK'' 89 {{{ 90 select urn, metric, ts, value, 'OK' AS alertlevel from LogTick(metric='gpo:is_available') where value = 1 91 }}} 92 93 * If metric ''gpo:is_available'' is set to ''1'' emit ''CRITICAL'' 94 {{{ 95 select urn, metric, ts, value, 'CRITICAL' AS alertlevel from LogTick(metric='gpo:is_available') where value = 0 96 }}} 97 98 * If a urn with the metric ''gpo:is_available'' is observed once, but not observed again for 60 min emit ''WARNING'' 99 {{{ 100 select a.urn AS urn, a.metric AS metric, a.ts AS ts , 'WARNING' AS alertlevel from pattern [ every a=LogTick(metric='gpo:is_available') -> (timer:interval(60 min)) and not LogTick(urn=a.urn) ] group by a 101 }}} 78 102 79 103 * Ping times greater than 10,000ms … … 82 106 }}} 83 107 108 * If a urn is seen and then not seen again for 60min 109 {{{ 110 select count(*) from pattern [ every a=LogTick -> (timer:interval(60 min)) and not LogTick(urn=a.urn) ] group by a 111 }}} 112 113 114 {{{ 115 116 }}} 117 84 118 85 119 *Image from RabbitMQ tutorial [https://www.rabbitmq.com/tutorials/tutorial-three-python.html]