Changes between Version 10 and Version 11 of GENIMonitoring/Alerts
- Timestamp:
- 06/11/15 09:35:58 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIMonitoring/Alerts
v10 v11 49 49 public static class LogTick 50 50 { 51 String source; 51 52 String urn; 52 53 String metric; … … 54 55 double value; 55 56 56 public LogTick(String urn, String metric, long ts, double value)57 public LogTick(String source, String urn, String metric, long ts, double value) 57 58 { 59 this.source = source; 58 60 this.urn = urn; 59 61 this.metric = metric; … … 61 63 this.value = value; 62 64 } 65 public String getSource() {return source;} 63 66 public String getUrn() {return urn;} 64 67 public String getMetric() {return metric;} … … 69 72 public String toString() 70 73 { 71 return " urn:" + urn + " metric:" + metric + " timestamp:" + ts + " value:" + value;74 return "source: " + source + " urn:" + urn + " metric:" + metric + " timestamp:" + ts + " value:" + value; 72 75 } 73 76 } … … 80 83 {{{ 81 84 ... 85 String source; 82 86 String urn; 83 87 String metric; … … 90 94 * If metric ''gpo:is_available'' is set to ''1'' emit ''OK'' 91 95 {{{ 92 select urn, metric, ts, value, 'OK' AS alertlevelfrom LogTick(metric='gpo:is_available') where value = 196 select 'nagiosserver.somedomain.com' AS nagiosserver, urn AS hostname, metric AS servicename, 'OK' AS alertlevel, 'Alert comes from rack ' || ' source:' || source AS alertmessage from LogTick(metric='gpo:is_available') where value = 1 93 97 }}} 94 98 95 99 * If metric ''gpo:is_available'' is set to ''1'' emit ''CRITICAL'' 96 100 {{{ 97 select urn, metric, ts, value, 'CRITICAL' AS alertlevelfrom LogTick(metric='gpo:is_available') where value = 0101 select 'nagiosserver.somedomain.com' AS nagiosserver, urn AS hostname, metric AS servicename, 'CRITICAL' AS alertlevel, 'Alert comes from rack ' || ' source:' || source AS alertmessage from LogTick(metric='gpo:is_available') where value = 0 98 102 }}} 99 103 100 104 * If a urn with the metric ''gpo:is_available'' is observed once, but not observed again for 60 min emit ''WARNING'' 101 105 {{{ 102 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 a106 select 'nagiosserver.somedomain.com' AS nagiosserver, a.urn AS hostname, a.metric AS servicename, 'WARNING' AS alertlevel, 'Alert comes from monitoring system ' || ' source:' || a.source AS alertmessage from pattern [ every a=LogTick(metric='is_responsive') -> (timer:interval(60 min)) and not LogTick(urn=a.urn) ] group by a 103 107 }}} 104 108