News:

We really need your input in this questionnaire

Main Menu

Querying DCI Table history

Started by SpotTheCat, October 01, 2020, 08:06:07 PM

Previous topic - Next topic

SpotTheCat

Hello Forum,

I know that a number of people have raised this but I can't find any answers on the forum.

I've seen this solution for getting the current values of a DCI table.

https://www.netxms.org/forum/general-support/get-values-from-a-dci-table-with-a-tranform-script/msg17281/#msg17281

That's great - but is there a similar way to enumerate and display the complete history for a DCI table? We have some monitors which get results of logins every few minutes. If there is a suspicious login it raises an alert. After 10 minutes the DCI table will no longer display the row but the alert will remain. As the identity column is just a session number that doesn't give us enough information to see who logged in and where from. So we need to be able to see the history. Also if we need to use this information for evidence then we'll need to get back to it to.

Perhaps a DCI table isn't the best way to do this but I can't see a better way to handle it at the moment. The main issue is that we're monitoring a cloud solution and the only way to pickup the logins is via their API for a period of time.

Best regards

Spot

Victor Kirhenshtein

Hi,

seems that currently it is not possible. There is feature request for that for some time already: https://track.radensolutions.com/issue/NX-1483, which we will definitely implement at some point. Also NXSL function GetDCIValues could be fairly easily modified to return list of table DCI values for given period.

Best regards,
Victor


Mishal

Hello Victor,

I would like to have the same feature to be able to query last values for a table row.
Is there a way to make feature request and github repository and then submit a pull request.

Thanks,
Mishal

Victor Kirhenshtein

Hi,

sure, you can clone our GitHub repository (https://github.com/netxms/netxms), do necessary changes, and submit a pull request (with usual GitHub mechanisms).

Best regards,
Victor

Mishal

Okay Victor,
Would appreciate it if you could point me towards a contribution guide and what part of the codebase contains these methods.

Victor Kirhenshtein

Hi,

most likely you'll have to look at NXSL extensions, data collection related functions are in src/server/core/dc_nxsl.cpp. Look for F_GetDCIValues - it is implementation of getting history for single value DCIs, and GetDCIValueImpl - it will give you idea how to return table value as NXSL object. Then you will need code to unpack table values. You can take a look at src/server/core/session.cpp, method ClientSession::getCollectedDataFromDB - you will be interested in code part around call Table::createFromPackedXML.

Best regards,
Victor