Node-Down-Config Question

Started by WilliCoyote, August 12, 2009, 03:31:10 PM

Previous topic - Next topic

WilliCoyote

Hello Victor,

I have the following two questions:

I only would like to trigger a SYS_NODE_DOWN event when two Nodes are down at the same time. how do

I determine the status of an arbitrary Nodes (not over $node !) in a Script (Event_Processing_Policy-Script) ?

What do I have to do to reach above?

Thanks Stefan

Victor Kirhenshtein

Hello!

You cannot change when SYS_NODE_DOWN sent. However, you can process it depending on other node's status using situations. For example, you have to nodes: node_A and node_B, and wish to track their status, you can do the following:

1. In console, go to View -> Situations;
2. Create new situation called NodeDown (you can choose any name of course);
3. Open event processing policy
4. Create new or change default rules for SYS_NODE_DOWN and SYS_NODE_UP events: in situation column, select Edit, than check "Update situation if current rule match"; select situation NodeDown; as situation instance, enter %n (this will create separate instance for each node, each instance identified by node name); in the attribute list, add attribute called "status" (again, you van choose any name here), and as value enter 1 for SYS_NODE_DOWN event, and 0 for SYS_NODE_UP.

Now we have defined situation, which will have separate instance for each node, and for each instance wil will have attribute "status" set to 1 if appropriate node is down, and to 0 if it is not.

Now you can use this information in filtering scripts by accessing the situation:

s = FindSituation("NodeDown", "node_name");

and looking at situation's attribute "status":

s->status

For example, if I wish that certain event will be processed only if both node_A and node_B are down, I can use the following filtering script:


sub main()
{
   s1 = FindSituation("NodeDown", "node_A");
   isDownA = (s1 != null) ? s1->status : 0;
   s2 = FindSituation("NodeDown", "node_B");
   isDownB = (s2 != null) ? s2->status : 0;
   return s1 && s2;
}


Construction (s1 != null) ? s1->status : 0 is needed because FindSituation will return null if given instance does not exist. In our example, if situation's instance for node does not exist, we assume that this node is up (status attribute equals 0).

Hope this helps!

Best regards,
Victor

WilliCoyote

Hello Victor,

many, many thanks for this

Stefan  ;D

joel4321

Hi Victor

I've implented everything according that post or according the manual.
Unfortunately I got an error during processing of the filtering script.

EventVwr:
Failed to execute evaluation script for event processing policy rule #63: Error 15 in line 4: Unknown object's attribute

I'm using the server version 1.0.4.
After hours of testing I can't solve that problem.
Is there any bug in that version? Sorry to ask you this, but I'm totally lost in that case  :-[

my script in the event processing of nodeB:
sub main() 
{
   s1 = FindSituation("ServiceStatus", "nodeA");
   isDownA = (s1 != null) ? s1->status : 0;
 
   return s1;
}

my settings in the event processing of nodeA:
attachment.
side note: also tried the attribute's name "status" without quotes.

thank you and best regards

Joël

Victor Kirhenshtein

Hi!

It's a bug in a server. I have fixed it, and version 1.0.8 should work fine. If you are running server on UNIX, I can post a patch. Also, as a workaround, you can use function GetSituationAttribute to get attribute's value instead of directly accessing it.

Btw, you should specify attribute name without quotes in configuration dialog.

Best regards,
Victor