mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #97] Feature Request: Allow the ability to sync agent tasks #1997
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#1997
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bradhawkins85 on GitHub (Sep 9, 2020).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/97
Originally assigned to: @sadnub on GitHub.
When removing a task from a policy the task is not removed from the agents.
Removing a policy from a client/site does not remove the tasks from the agents.
@sadnub commented on GitHub (Sep 9, 2020):
@bradhawkins85 Thanks for bringing this up. I will need to rework the task deletion since it tries once to delete the task(s) from the agents then deletes the task from the UI. I think I can add a pending_deletion field to the task and check this once the agent checks in, so that offline agents will eventually get the tasks cleaned up. I will work on this.
@bradhawkins85 commented on GitHub (Sep 10, 2020):
thanks @sadnub
I was actually meaning that the tasks were not removing from the webui but it appears they just took a while.
pending_deletion would be good though if the agents are not removing the scheduled tasks due to being offline.
Is there a way we can clean up scheduled tasks as part of this fix to tidy up old tasks that did not get removed previously?
@sadnub commented on GitHub (Sep 10, 2020):
When checks and tasks are modified, a background task is fired off to perform the action, so the UI can return a response faster. If there are a large number of agents affected it could take a little bit for the affected checks and tasks to get deleted/created.
For cleaning up orphaned tasks on the agent that might get tricky. I could try and create a python script to compare the agent tasks and the UI and delete if it doesn't have a reference. I will have to test that.
I do have a fix for the orphaned tasks implemented, but I need to do more testing. Should be this evening.
@sadnub commented on GitHub (Sep 11, 2020):
#100 Adds the reliable task edits on the agent. Still working on cleanup for existing agents
@sadnub commented on GitHub (Sep 14, 2020):
I was thinking about this more and it might be beneficial to have a sync tasks agent command. This will help if a task gets deleted from the agent on accident.
@bradhawkins85 commented on GitHub (Sep 14, 2020):
@sadnub sounds like a brilliant idea.
The task could remove all tactical rmm tasks and re-create them that would handle the clean up as well.
@sadnub commented on GitHub (Oct 30, 2020):
@bradhawkins85 I just added a PR with adds command to remove tasks on agents that are already removed from the UI. You can run
python manage.py remove_orphaned_taskson the server and it will cycle through all agents.@bradhawkins85 commented on GitHub (Oct 30, 2020):
Thank you @sadnub will give it a run once the PR is merged.
@bradhawkins85 commented on GitHub (Nov 2, 2020):
@sadnub i'm getting an error when running the script:
I only have python3 not python so not sure if this is the issue.
tactical@tactical:/rmm/api/tacticalrmm$ python3 manage.py remove_orphaned_tasks
Traceback (most recent call last):
File "manage.py", line 10, in main
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 12, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
@wh1te909 commented on GitHub (Nov 2, 2020):
you have to activate the python virtual environment first