NetXMS Support Forum

English Support => General Support => Topic started by: maggio on April 29, 2010, 03:50:35 PM

Title: DCI with Multiple OID
Post by: maggio on April 29, 2010, 03:50:35 PM
Hi,

I have a question how can I calculate DCI with Multiple OIDs.

ifInOctets  -->  .1.3.6.1.2.1.2.2.1.10
ifSpeed  -->  .1.3.6.1.2.1.2.2.1.5

I would like  to calculate the belows;

((ifInOctets) * 8 / ifSpeed) * 100
((ifOutOctets) * 8 / ifSpeed) * 100

Could you le me know how can I make the script code?

Thanks a lot.
Maggio
Title: Re: DCI with Multiple OID
Post by: Victor Kirhenshtein on April 29, 2010, 11:54:22 PM
You should create two DCIs, and transform one of it using value from another. For example, define DCI for interface speed (.1.3.6.1.2.1.2.2.1.5.1); leave it as is. Then, define DCI for inOctets (.1.3.6.1.2.1.2.2.1.10.1), and set transformation script to


sub main()
{
   ifSpeed = GetDCIValue($node, FindDCIByName($node, ".1.3.6.1.2.1.2.2.1.5.1"));
   return ($1 * 8 / ifSpeed) * 100;
}


See also this topic: https://www.netxms.org/forum/index.php/topic,289.0.html (https://www.netxms.org/forum/index.php/topic,289.0.html)

Best regards,
Victor
Title: Re: DCI with Multiple OID
Post by: maggio on April 30, 2010, 01:37:56 PM
Thanks. Seems works fine.