NetXMS Support Forum

English Support => General Support => Topic started by: Spheron on January 15, 2026, 11:33:16 AM

Title: User Sessions > Log to Events
Post by: Spheron on January 15, 2026, 11:33:16 AM

Hello @all,

is it possible to log the user sessions (User, Client name, Client Adress, ...) to the NetXMS event log?

Greetings
Marco
Title: Re: User Sessions > Log to Events
Post by: Filipp Sudanov on January 23, 2026, 12:42:01 PM
We have this information in Audit log, but if you need it in Event Log - there's Hook::login script in script library that you can use for that. Make sure that this script returns true, otherwise it will prevent users from logging in.

To see what attributes are available in this script you can try this - it will log details to server log:

for (a : $user.__class.attributes) trace(0, "$user." .. a .. " = " .. $user.__get(a));
for (a : $session.__class.attributes) trace(0, "$session." .. a .. " = " .. $session.__get(a));
return true;

Then you can use PostEvent() or PostEventEx() to create the event (https://netxms.org/documentation/nxsl-latest/#func-postevent), drop us a line if you need more help with scripting.