Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Commit

Permalink
Release 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Aug 24, 2020
2 parents 38a5c6c + de74920 commit 73740fd
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 65 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.1
0.10.2
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Tactical RMM Agent"
#define MyAppVersion "0.10.1"
#define MyAppVersion "0.10.2"
#define MyAppPublisher "wh1te909"
#define MyAppURL "https://github.com/wh1te909"
#define MyAppExeName "tacticalrmm.exe"
Expand Down
31 changes: 29 additions & 2 deletions winagent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ async def event_log_check(self, data):
api_fail_when = data["fail_when"]
api_search_last_days = int(data["search_last_days"])

try:
api_event_id_is_wildcard = data["event_id_is_wildcard"]
except KeyError:
api_event_id_is_wildcard = False

if api_search_last_days != 0:
start_time = dt.datetime.now() - dt.timedelta(days=api_search_last_days)

Expand Down Expand Up @@ -502,7 +507,10 @@ async def event_log_check(self, data):
"uid": uid,
}

if int(evt_id) == api_event_id and evt_type == api_event_type:
if api_event_id_is_wildcard and evt_type == api_event_type:
log.append(event_dict)

elif int(evt_id) == api_event_id and evt_type == api_event_type:
log.append(event_dict)

if done:
Expand Down Expand Up @@ -575,7 +583,26 @@ def get_used_ram(self):
return round(psutil.virtual_memory().percent)

def get_services(self):
return [svc.as_dict() for svc in psutil.win_service_iter()]
# see https://github.com/wh1te909/tacticalrmm/issues/38
# for why I am manually implementing the svc.as_dict() method of psutil
ret = []
for svc in psutil.win_service_iter():
i = {}
try:
i["display_name"] = svc.display_name()
i["binpath"] = svc.binpath()
i["username"] = svc.username()
i["start_type"] = svc.start_type()
i["status"] = svc.status()
i["pid"] = svc.pid()
i["name"] = svc.name()
i["description"] = svc.description()
except Exception:
continue
else:
ret.append(i)

return ret

def get_total_ram(self):
return math.ceil((psutil.virtual_memory().total / 1_073_741_824))
Expand Down
Loading

0 comments on commit 73740fd

Please sign in to comment.