[Nodebrain-users] Is this a bug, or am I not getting it....
Rule Engine for State and Event Monitoring
Brought to you by:
trettevik
From: <gh...@rl...> - 2003-08-05 19:25:43
|
Below is a block of code, and the out come. Tell me if you see something wrong.I made up 6 case where all the rules should fire, but not all of them do. On the second alert only 4 out of 6 fire. On the third alert only 1 out of 3 fire. I am looking at this becuase I want to make a context per node, and have rules that include multiple nodes, so multiple contexts. The easiest syntax would be P_1a/b. P_2a/b work, but is to limited. -Gilbert. ------------------- CODE ---------------------------- define M_21 context; #P_1 define P_1a on(M_21.Warning>=M_21.numnodes):- echo "Policy fired 1a" >> /tmp/policy.txt define P_1b if(M_21.Warning>=M_21.numnodes):- echo "Policy fired 1b" >> /tmp/policy.txt #P_2 M_21 define P_2a on(Warning>=numnodes):- echo "Policy fired 2a" >> /tmp/policy.txt M_21 define P_2b if(Warning>=numnodes):- echo "Policy fired 2b" >> /tmp/policy.txt #P_3 alert T_3==(M_21.Warning>=M_21.numnodes); define P_3a on(T_3):- echo "Policy fired 3a" >> /tmp/policy.txt define P_3b if(T_3):- echo "Policy fired 3b" >> /tmp/policy.txt M_21 alert Warning=0,numnodes=1; M_21 alert Warning=1,numnodes=1; M_21 alert Warning=1,numnodes=1; show -cells; show P_1a; show P_1b; show M_21.P_2a; show M_21.P_2b; show P_3a; show P_3b; -------------- Output ------------------------ --- 4 out of 6 2003/08/05 01:45:43 NB000I Rule "@.P_3a" fired > - echo "Policy fired 3a" >> /tmp/policy.txt 2003/08/05 01:45:43 NB000I Rule "P_2a" fired > - echo "Policy fired 2a" >> /tmp/policy.txt 2003/08/05 01:45:43 NB000I Rule "@.P_1a" fired > - echo "Policy fired 1a" >> /tmp/policy.txt 2003/08/05 01:45:43 NB000I Rule "P_2b" fired > - echo "Policy fired 2b" >> /tmp/policy.txt --- 1 out of 3 2003/08/05 01:59:34 NB000I Rule "P_2b" fired > - echo "Policy fired 2b" >> /tmp/policy.txt T_3 = 1 == (M_21.Warning>=M_21.numnodes) M_21.numnodes = 1 M_21.Warning = 1 M_21.OK = 0 @> P_1a on(M_21.Warning>=M_21.numnodes):- echo "Policy fired 1a" >> /tmp/policy.txt @> P_1b if(M_21.Warning>=M_21.numnodes):- echo "Policy fired 1b" >> /tmp/policy.txt @> M_21.P_2a on(M_21.Warning>=M_21.numnodes):- echo "Policy fired 2a" >> /tmp/policy.txt @> M_21.P_2b if(M_21.Warning>=M_21.numnodes):- echo "Policy fired 2b" >> /tmp/policy.txt @> P_3a on(T_3):- echo "Policy fired 3a" >> /tmp/policy.txt @> P_3b if(T_3):- echo "Policy fired 3b" >> /tmp/policy.txt |