News:

We really need your input in this questionnaire

Main Menu

Calculated DCI

Started by Victor Kirhenshtein, April 11, 2008, 10:13:57 AM

Previous topic - Next topic

Victor Kirhenshtein

From messages:

Quote from: Rando on April 11, 2008, 02:47:38 AM
Sorry, I didn't read the last part of the message.  Yes, you can transfer this to the forum.  I'm still struggling with the scripting.  Is there any examples with descriptions I can look at to see the structure and usage?  I'm just going through the manual right now.

Quote from: Victor Kirhenshtein on April 07, 2008, 04:37:10 PM
Quote from: Rando on April 07, 2008, 09:19:18 AM
I'm still learning the NetXMS software and have a wireless base station and remote wireless radios which is SNMP capable and I do get a signal value and a noise value.  For me to calculate the signal to noise ratio I have to subtract these two numbers to create a 3rd value that I would need to track.  Is there any way NetXMS can do this?

Yes, it's possible. You should define two DCIs, one will collect signal value, and other noise value. Then, for one DCI you can create transformation script, which will access last value of other DCI and use it in transformation. You can access other DCI value using built-in functions GetDCIValue and FindDCIByName or FindDCIByDescription. See user's manual for description of these functions (section 8.5.3).
You script may looks like following (assuming that you are transforming signal value and your noise DCI called "Noise Level"):


$1 - GetDCIValue($node, FindDCIByDescription($node, "Noise Level"))


Best regards,
Victor

P.S. Can we move this discussion to the forum because this information may be useful for others?


sunil2suss

Hi Victor,

I have defined two DCI for my Layer-2 switch. I need to add them together and generate as a third DCI. Is it possible to do?

Victor Kirhenshtein

Hi!

Yes, it is possible. You should create third DCI with the solurce set to "Internal" and parameter name set to "Dummy". This will generate zeros on given interval. Then, in transformation script you can access both DCIs you have configured and calculate value for your new DCI. Example transformation script:


value1 = GetDCIValue($node, FindDCIByDescription($node, "My DCI #1 description"));
value2 = GetDCIValue($node, FindDCIByDescription($node, "My DCI #2 description"));
return value1 + value2;


Best regards,
Victor