NodeBrain  Demonstration Site
A Rule Engine for State and Event Monitoring     

IfAlertOnAssert

Next  Prior  Up        Home        
This demonstration illustrates how state monitoring and event monitoring can be performed on the same terms. For state monitoring, ON rules are used with ASSERT or ALERT commands. For event monitoring, IF rules are used with ALERT commands. An ASSERT command will never cause an IF rule to fire, as demonstrated by the first ASSERT transaction, where r2 does not fire. An ON rule only fires when it transitions to true, as demonstrated by the first ALERT transaction, where r1 does not fire.
Tutorial: Formulas Rules     Language: Formulas Define Assert Alert

Rules

Transactions

Log

again after modifications.     Reset to orignal rules and transactions.

N o d e B r a i n   0.9.04 (Columbo) 2015-09-24
Spec 0.0.904 built for x86_64-redhat-linux-gnu
Copyright (C) 2014-2015 Ed Trettevik <eat@nodebrain.org>
MIT or NodeBrain License
----------------------------------------------------------------
/usr/bin/nb = ++safe 
Date       Time     Message
---------- -------- --------------------------------------------
2017-06-23 15:20:55 NB000I NodeBrain nb[24682] apache@ip-172-31-40-21.us-west-2.compute.internal
2017-06-23 15:20:55 NB000I Argument [1] =
2017-06-23 15:20:55 NB000I Reading from standard input.
---------- --------
Rules
| define r1 on(a and b);
| define r2 if(a and b);
| define r3 if(?a);
| define r4 on(?a);
Transactions
| assert a,b; # expect r1 to fire
2017-06-23 15:20:55 NB000I Rule r1 fired 
| alert a,b; # expect r2 to fire
2017-06-23 15:20:55 NB000I Rule r2 fired 
| assert !a; # expect nothing
| alert a,b; # expect r1 and r2 to fire
2017-06-23 15:20:55 NB000I Rule r1 fired 
2017-06-23 15:20:55 NB000I Rule r2 fired 
| alert b; # expect r3 and r4 to fire
2017-06-23 15:20:55 NB000I Rule r4 fired 
2017-06-23 15:20:55 NB000I Rule r3 fired 
| show a,b;
a = ?
b = !!
2017-06-23 15:20:55 NB000I NodeBrain nb[24682] terminating - exit code=0