NetXMS Support Forum

English Support => General Support => Topic started by: SpotTheCat on October 01, 2020, 08:06:07 PM

Title: Querying DCI Table history
Post by: SpotTheCat on October 01, 2020, 08:06:07 PM
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
Title: Re: Querying DCI Table history
Post by: Victor Kirhenshtein on October 04, 2020, 02:25:30 PM
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 (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

Title: Re: Querying DCI Table history
Post by: Mishal on September 02, 2021, 09:35:57 AM
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
Title: Re: Querying DCI Table history
Post by: Victor Kirhenshtein on September 09, 2021, 10:47:01 AM
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
Title: Re: Querying DCI Table history
Post by: Mishal on September 20, 2021, 06:59:46 AM
Okay Victor,
Would appreciate it if you could point me towards a contribution guide and what part of the codebase contains these methods.
Title: Re: Querying DCI Table history
Post by: Victor Kirhenshtein on September 23, 2021, 02:39:56 PM
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