GetEventLines returning zero results

I am trying to poll the VMS for a list of events from a C# application using the nuget package. The VMS servers are 2022 R3c.

Registering and receiving events works fine - but requesting existing events always returns 0 results.

The Alarm & Event Viewer sample works the same - it doesn’t load an initial list (zero results), only the only the events going forward are displayed.

Any assistance would be appreciated.

There might be a simple explanation. By default XProtect will not save events, so the moment they have occurred they are forgotten. To change this, in the Management Client, open Tools → Options, find the Alarms and Events tab, here you can configure saving events by setting a retention bigger than zero.

Be careful, this can cause the SQL Server database to overfill..

Thank you very much Bo - this was indeed the issue. I have just set all categories to 1 day, hopefully it shouldn’t cause too much database bloat.

Might be worth a note in the API docs that GetEventLines requires non-default config to function?