NetXMS Support Forum

English Support => General Support => Topic started by: SteveK on January 11, 2011, 03:04:23 AM

Title: Problem with Node-Down-Configuration using situation
Post by: SteveK on January 11, 2011, 03:04:23 AM
Hi

I have been trying to trigger a SYS_NODE_DOWN event by checking if another Node is not down. I have implemented as per manual and various other posts, but still cannot get it to work.

I have attempted to do this by creating a situation, as per thread https://www.netxms.org/forum/configuration/node-down-config-question/ (https://www.netxms.org/forum/configuration/node-down-config-question/), however I  want to report only if nodeB is not down (nodeB being the remote router, and NodeA is a device on the remote network).

In a previous thread, Victor stated that you should be able to see situation, instance and attribute from console https://www.netxms.org/forum/configuration/action-to-return-value/ (https://www.netxms.org/forum/configuration/action-to-return-value/), however I can only see the situation and instance, but not the attribute - maybe this is the problem?(see attachment).

My situation created is:
Event: SYS-NODE-DOWN, Situation Name = NodeDown, situation instance = %n, Attribute: status = 1. This will create a NodeDown situation instance for each node with a status = 1 for a sys_node_down
Event: SYS-NODE-UP, Situation Name = NodeUp, situation instance = %n, Attribute: status = 0. This will create a NodeDown situation instance for each node with a status = 0 for a sys_node_up

I have setup an event process policy for a separate host that I want to report on if the router (dev2rtr) is NOT down:
My script in this event processing policy is:

// We only want to send alert if router is not down
sub main()
{
  s = FindSituation("NodeDown", "dev2rtr");
  if (s != NULL)
  {
  if (s->status == 1)
     return 0; // Don't match rule
  }
  return 1; // Match rule
}


I am using version 1.08 on a windows platform.

Appreciate any help with this,
Steve...
Title: Re: Problem with Node-Down-Configuration using situation
Post by: Victor Kirhenshtein on January 11, 2011, 11:10:24 PM
Hi!

Try to use GetSituationAttrubute(s, "status") instead of s->status - there was a bug report that latter method of accessing situation's attributes still not working, although I was thinking that I have fixed it for 1.0.8 - I still didn't check that myself (see this: https://www.netxms.org/forum/configuration/logwatch-function/msg4934/#msg4934 (https://www.netxms.org/forum/configuration/logwatch-function/msg4934/#msg4934)).

Best regards,
Victor
Title: Re: Problem with Node-Down-Configuration using situation
Post by: SteveK on January 11, 2011, 11:42:41 PM
Hi Victor,

Thanks for the reply.

I still am having problems with my implementation, should I be able to see the attributes in situation manager?, as I can see the instance, but cannot see the attribute.

Many thanks,
Steve..
Title: Re: Problem with Node-Down-Configuration using situation
Post by: SteveK on January 12, 2011, 06:02:05 AM
Hi Victor,

Sorry I missed the bit in the post you referred to about situation attributes. Thanks for your help.

Steve...