NetXMS Support Forum

English Support => General Support => Topic started by: hoeth on March 28, 2020, 12:36:25 PM

Title: PushDCIData() doesn't seem to do anything
Post by: hoeth on March 28, 2020, 12:36:25 PM
Hi,

I'm trying to use PushDCIData() on NetXMS 3.2.400 to update DCIs based on SNMP traps, but even a simple test script doesn't do anything for me. This is what I do for testing:

PushDCIData($node,38620,1);

I've tried running this script manually ("node -> execute server script") or triggered by a trap. I've tried entering the DCI id manually (as shown above) or by using FindDCIByName(). I've verified that FindDCIByName() gives the correct output (print(FindDCIByName()). Whatever I do, the DCI remains unchanged.

Any ideas what I'm doing wrong?

Thanks,

        Hendrik
Title: Re: PushDCIData() doesn't seem to do anything
Post by: Filipp Sudanov on March 30, 2020, 05:55:02 PM
I believe PushDCIData will update only DCIs that have origin "Push".
Title: Re: PushDCIData() doesn't seem to do anything
Post by: hoeth on April 01, 2020, 12:29:44 PM
Ah, that works! Thanks!

But this triggers another question: My plan was to have a DCI that is updated every hour through SNMP polls and additionally through SNMP traps triggering PushDCIData() (whenever the value changes on the client). Is there a clever way of doing this? Maybe always use traps? Or can I update DCIs through SNMP traps using a different mechanism than PushDCIData()?
Title: Re: PushDCIData() doesn't seem to do anything
Post by: Filipp Sudanov on April 01, 2020, 02:40:07 PM
There could be better options, but one I can think of would be to create 2 DCIs:
- one with "Push" origin - that would be the actual DCI.
- another on that receives data via SNMP polls. You can put Retention time = 0, in that case it will not store anything to DB. In transformations script you can PushDCIData into the first DCI.
Title: Re: PushDCIData() doesn't seem to do anything
Post by: hoeth on April 01, 2020, 11:14:16 PM
Good idea, works fine! Thanks a lot!