Need help about APIs to access Historical Data

We are working on developing a module and wish to access the historical information (i.e. how many users accessed, from what IP address, what role, etc in last 24 hours or last week or even month). Does Ignition log and save this information? If so, it is available for what period (like a day or week or month)? Can our module fetch it from Ignition?

We were trying out methods from gatewayContext
• AuditManager (i.e. context.getAuditManager().getProfileForProject().query())
• AlarmManager(context.getAlarmManager().queryStatus());
However, from the information in Javadocs, it’s not clear exactly what historical information would be available.

Would the methods from HistoryManager and SQLTagsManager be useful?

Thanks.

I did some digging and you can get part way there by using the GatewaySessionManager. You may be able to store this information yourself if you can get it however.

GatewayContext context; (String) context.getGatewaySessionManager().findSessions().get(0).getAttribute(ClientReqSession.SESSION_USERNAME);
This gets the username of a session that’s open. You can get other information if you look at the ClientReqSession class. If you really wanted to record all of this information though, you would want to define a listener and get notified of when it changes. I can’t find any way for you to add listeners for sessions though. Maybe someone else will know that bit. :smiley:

Or you could query this from the AUDIT_EVENTS table using SQL.

Thanks. I am using this API to get the real time data and querying AUDIT_EVENTS table to get historical data.

This is not the kind of information that Ignition stores or logs anywhere, in either the auditing or history systems.