Active sessions - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2) +--- Thread: Active sessions (/showthread.php?tid=1048) |
Active sessions - Thomas - 19.10.2017 Hi Can I see opened sessions? I mean IP address, username, last request, idle time etc. I haven't found such window so I'm thinking about a database query. Is it possible? RE: Active sessions - Erwin van der Zwart - 19.10.2017 Hi, Getting client IP is possible (also by .lp as this must be server side handled) but the other items are not available, at least not in the DB.. By why? What is the use case? BR, Erwin RE: Active sessions - Thomas - 24.10.2017 Hi I would like to see who's online and from where. My actual problem was to identify computers where a specific user was logged on. Because I a plan to disable that user and I wanted to change credentials on affected computers. But the main reason is security. I simply want to see who's logged on, from where and how long. Every other systems like databases, domain controllers etc. supports this function. I understand LM is mainly focused to home / SoHo market but I think if you add few security features like I mentioned above, access rights to user groups and not to user, roles, LDAP authorization, logging then LM will be great tool for enterprise too. Could you send me that database query please? Thank you RE: Active sessions - Erwin van der Zwart - 24.10.2017 Hi, As mentioned before, the data is not available in the DB so there is no query to get the data you want .. BR, Erwin RE: Active sessions - Thomas - 24.10.2017 You wrote "Getting client IP is possible". Could you please send me query for getting IP addresses? Thank you. RE: Active sessions - Erwin van der Zwart - 24.10.2017 Hi, If you want to have a solution for enterprise market you might better look at our solution Schneider Electric Ecostruxure™ Building Operation, this platform is fully compatible with latest IT standards, LDAP, SSO, domains and communicates secure over HTTPS between all locations (worldwide) of the enterprise. spaceLYnk and homeLYnk are used in these kind of architectures as powerfull bridge to KNX. This platform brings all power of KNX, BACnet (MSTP and IP), LON, Modbus (RTU and IP), Webservices and IT standards together in the most powerfull way. See: Ecostruxure™ Building Operation But if you want to use LM for monitoring access logs you can try this: Code: db:getall('SELECT * FROM user_logs') Erwin RE: Active sessions - Thomas - 02.11.2017 If someone is interested in then there's working code: Store the code in your library Call it in your init script Call user/sessions.lp in a frame in your visu. Code: function ecl_init_sessions() RE: Active sessions - admin - 02.11.2017 The same data can be viewed in User access > Access logs RE: Active sessions - Thomas - 02.11.2017 (02.11.2017, 14:29)admin Wrote: The same data can be viewed in User access > Access logs Hmm, you're right. Can I filter in the query just active sessions? Thank you RE: Active sessions - Erwin van der Zwart - 02.11.2017 Hi, Only thing you can do is compare created time stamp with os.time(), i also wouldn't use io.writefile in these kind of scripts as a lot of writing to SD card is not adviced.... BR, Erwin RE: Active sessions - Thomas - 07.11.2017 (02.11.2017, 19:20)Erwin van der Zwart Wrote: Hi, Only thing you can do is compare created time stamp with os.time() Unfortunately I can't. Created looks like the time of the first contact. Not the latest request taken from the client. In my network I've computers logged on with active session for months. i also wouldn't use io.writefile in these kind of scripts as a lot of writing to SD card is not adviced.... Thsi script runs only once as a part of the init script. It just creates sessions.lp file. RE: Active sessions - admin - 08.11.2017 Active connections are not stored anywhere. It's possible to get a list of IPs that are currently connected to the system from the OS but then you won't have login names. RE: Active sessions - Thomas - 08.11.2017 List of IPs would be enoughfor me if there's no a better solution. How can I obtain it? RE: Active sessions - admin - 09.11.2017 You can filter the result by local port (80 or 443) and also by TCP state. TCP_ESTABLISHED should be enough since visualization uses web sockets where connection is always open during an active session. Code: states = { RE: Active sessions - Thomas - 09.11.2017 Thank you |