Changes between Version 10 and Version 11 of GENIMonitoring/Alerts


Ignore:
Timestamp:
06/11/15 09:35:58 (6 years ago)
Author:
cody@uky.edu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIMonitoring/Alerts

    v10 v11  
    4949public static class LogTick
    5050{
     51        String source;
    5152        String urn;
    5253        String metric;
     
    5455        double value;
    5556       
    56         public LogTick(String urn, String metric, long ts, double value)
     57        public LogTick(String source, String urn, String metric, long ts, double value)
    5758        {
     59            this.source = source;
    5860            this.urn = urn;
    5961            this.metric = metric;
     
    6163            this.value = value;
    6264        }
     65        public String getSource() {return source;}
    6366        public String getUrn() {return urn;}
    6467        public String getMetric() {return metric;}
     
    6972        public String toString()
    7073        {
    71                 return "urn:" + urn + " metric:" + metric + " timestamp:" + ts + " value:" + value;
     74                return "source: " + source + " urn:" + urn + " metric:" + metric + " timestamp:" + ts + " value:" + value;
    7275        }
    7376    }
     
    8083{{{
    8184        ...
     85        String source;
    8286        String urn;
    8387        String metric;
     
    9094 * If metric ''gpo:is_available'' is set to ''1'' emit ''OK''
    9195{{{
    92 select urn, metric, ts, value, 'OK' AS alertlevel from LogTick(metric='gpo:is_available') where value = 1
     96select '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
    9397}}}
    9498
    9599 * If metric ''gpo:is_available'' is set to ''1'' emit ''CRITICAL''
    96100{{{
    97 select urn, metric, ts, value, 'CRITICAL' AS alertlevel from LogTick(metric='gpo:is_available') where value = 0
     101select '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
    98102}}}
    99103
    100104 * If a urn with the metric ''gpo:is_available'' is observed once, but not observed again for 60 min emit ''WARNING''
    101105{{{
    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 a
     106select '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
    103107}}}
    104108