Hi Martial,

 

As agreed at the last weekly meeting of CLAMP, I’m sending a (quite simple but 
easy-to-understand) sample rule of Holmes (see below). To create such a rule, 
some information for alarm identification, such as alarm code or alarm name, 
resource (where the alarm is raised) information, etc. must be provided in 
advance.

 

===================== rule starts here =====================

package gsm.bsc.test

import xxx.xxx.xxx

 

rule "NFVO_SameHost_Relation_Rule"  

salience 120

no-loop true

when

    $root : Alarm(  eventType == Alarm.EVENT_RAISED, 

        probableCause == "RAM error",      

        $hostname:hostname, hostname != null && !hostname.equals(""),

        $vmname:vmname, vmname == null || vmname.equals(""),

        $aid: aid)        

    $child : Alarm( eventType == Alarm.EVENT_RAISED, aid != $aid,

        hostname == $hostname, 

        probableCause in ( "compute is not available","VNF IP NSVC unavailable" 
),

        this after [-60s, 60s] $root)         

then    

    AplusServiceAccess.getAplusOutputService().publishRootChildResult("rule1", 
$root, $child)

end

 

rule "NFVO_Notify_Policy_Rule"  

salience 120

no-loop true

when

    $alarm : Alarm(  eventType == Alarm.EVENT_RAISED, 

        probableCause == "RAM error",        

        $hostname:hostname, hostname != null && !hostname.equals(""),

        $vmname:vmname, vmname == null || vmname.equals(""),

        $aid: aid)                      

then 

    Event event = new Event($alarm)  

    AplusServiceAccess.getAplusOutputService().sendEvent("rule2", event)

end

===================== rule ends here =====================




The question from Holmes’ side is how CLAMP template is translated into this 
kind of rule? It’ll be great if you could give us a sample of a CLAMP template 
and the corresponding Policy rule.

 

I’m not sure whether the info above would be useful or not for you. If  further 
information about Holmes and the rules is needed. Please feel free to contact 
me.

 

BR,

 

Guangrong
_______________________________________________
onap-discuss mailing list
[email protected]
https://lists.onap.org/mailman/listinfo/onap-discuss

Reply via email to