PushDCIData() doesn't seem to do anything

Started by hoeth, March 28, 2020, 12:36:25 PM

Previous topic - Next topic

hoeth

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

Filipp Sudanov

I believe PushDCIData will update only DCIs that have origin "Push".

hoeth

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()?

Filipp Sudanov

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.

hoeth