NetXMS Support Forum

English Support => General Support => Topic started by: testos on February 23, 2011, 03:29:02 PM

Title: Complex container status
Post by: testos on February 23, 2011, 03:29:02 PM
Hi again!

My network provider supplies me a main 100 Mbs bandwith line (A) and a backup 10 Mbs bandwith line (B) for a given location.  I need status container follow:

A status Up Up Down Down
B status Up Down Up Down
Location status Normal Normal Minor Major


I have created a condition under same container of A and B, with next condition script:

//trace(0,$1);
//trace(0,$2);
if ($1>0){
if ($2>0)
return 3; //Return MAJOR
else
return 2; // return MINOR
}
return 0; // return NORMAL
// blank last line is required for elude:
// syntax error, unexpected '/', expecting $end



Please, is there any way to change condition active state defined in General tab, from inside script?
Please, is there another way to get needed states?

Thanks in advance.
Title: Re: Complex container status
Post by: Victor Kirhenshtein on February 24, 2011, 12:06:24 PM
Hi!

What is A, B, and "Location" - containers? If you need to calculate status of Location based on statuses of subcontainers A and B, the beset way is to use status calculation/propagation rules. If this is the case, tell me what statuses could have A and B, and I'll try to create rules for your requirement.

Best regards,
Victor
Title: Re: Complex container status
Post by: testos on February 24, 2011, 01:44:30 PM
Hi.

A and B are routers nodes.
"Location" is a container for A and B nodes: the city where they are located.

Next table show status for "Location" container, based in A and B nodes statuses:

If node A change to               Normal      Normal      Critical         Critical
If node B change to               Normal      Critical      Normal         Critical
Location status must be     Normal     Normal     Minor          Major
.

However, I believe that a condition should be able to change his status to the same status returned from his own script.

Best regards.
Title: Re: Complex container status
Post by: Victor Kirhenshtein on February 25, 2011, 02:15:16 PM
Hi!

Condition can have only two statuses - when it is active and when it is not active. Condition script expected to return true or false - if it returns true, condition considered as "active", and it's status changed appropriately.

For your case, I see the following solution (not very elegant though):

1. On nodes A and B, set status propagation to fixed value "Normal" - this will ensure that they will not change status of parent location directly;
2. Create 2 conditions in same location, each having DCI Status for node A and node B as data (A Status first).
3. For condition 1, set active status to "Minor" and inactive to "Normal", and use the following script:

($1 == 4) && ($2 == 0)


3. For condition 1, set active status to "Major" and inactive to "Normal", and use the following script:

($1 == 4) && ($2 == 4)

Should work :)

Best regards,
Victor
Title: Re: Complex container status
Post by: testos on March 01, 2011, 02:46:39 PM
Hi Victor,

Of course, by using two or more conditions!. I would have never come to mind :-[.

Now, desired container status work fine.

Thank you very much again.