How to Identify the User Who Turns Off Hamachi?
- 20 days ago
I created a Python script that checks if my Hamachi network adapter is on or off. When it detects that Hamachi has been turned off, it uses PyAutoGUI to search for the button and click it to turn Hamachi back on immediately.
This solves the issue of having to manually reactivate Hamachi each time it’s turned off.
To identify which user turned it off, I set up the script to check the folder C:/Users whenever it detects that Hamachi is off. For each user, it goes to C:\Users\username\AppData\Local\LogMeIn Hamachi\h2-ui.log. This file is a log of Hamachi's interface, and when someone turns off Hamachi using the button, a line like this appears in their log:
10/31 19:19:22.841 ipc: sending disconnect
The script scans all users' logs and checks if any of them contain this line with the date matching when Hamachi was turned off, and if it finds this line, it tells me who turned it off.