Author Topic: Is it possible to control NetXMS cache?  (Read 485 times)

Sch.Donat

  • Newbie
  • *
  • Posts: 28
    • View Profile
Is it possible to control NetXMS cache?
« on: December 02, 2019, 02:29:12 pm »
Hi!

I have a few questions regarding NetXMS database caching:

Is it possible to turn off caching and set it to write to database instead?
Is the cache flushing time based or data based? If it is time based, is it possible to set the interval?

I'm using custom attributes to store some user specified data, which I need to query from DB. I would like to avoid using the web API.

Best regards,
Sch. Donat

Tatjana Dubrovica

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #1 on: December 03, 2019, 04:46:12 pm »
Hi,

It is not possible to turn off caching, but you can set synchronization interval by changing server configuration parameter: "SyncInterval".

Sch.Donat

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #2 on: December 04, 2019, 07:30:45 pm »
Hi!

Thanks for the answer, it works great when I change the Custom Attribute from the NetXMS Management Console via the object properties. I can see the changes after the specified time (in SyncInterval).
Changing Custom Attributes from script, however, doesn't seem to work. I can see the change in the console, but the server doesn't write it to the database. If I restart the server, the change is completely lost (I can't see it in the console anymore).

I use the following script, maybe I'm missing something:

Code: [Select]
SetCustomAttribute($node, "operationalstatus", "status");
Best regards,
Sch.Donat

Tatjana Dubrovica

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #3 on: December 04, 2019, 10:11:52 pm »
Looks like a bug I'll check it.

What server version do you use?
« Last Edit: December 04, 2019, 10:18:49 pm by Tatjana Dubrovica »

Sch.Donat

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #4 on: December 05, 2019, 12:55:10 pm »
I tried it in the latest 3.0 version (I'll check the exact version in a few hours) and in 2.2.16, I haven't tried it in 3.1 yet.

Edit: server version: 3.0.2357-1 amd64
Client version:  3.0.2329

Best regards,
Sch.Donat
« Last Edit: December 05, 2019, 07:36:14 pm by Sch.Donat »

Tatjana Dubrovica

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #5 on: December 09, 2019, 12:55:04 pm »
This bug is present in both 3.0 and current 3.1. It will be fixed in next patch release.

Sch.Donat

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Is it possible to control NetXMS cache?
« Reply #6 on: December 09, 2019, 01:22:00 pm »
Thank you.

Best regards,
Sch.Donat