mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #808] Script Check and Task Issues #509
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#509
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 @Layer-3s on GitHub (Nov 18, 2021).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/808
Server Info (please complete the following information):
Installation Method:
Agent Info (please complete the following information):
Describe the bug
Not sure if bug, or I'm misunderstanding the "Script Checks" option. Currently I have a Powershell script check that looks for installed software, if the software is installed it exit's with code 0 (success, as I want the software to be installed), if the software is not installed it exit's with code 1. Under my test device that check shows "Error" which is the result I want, as the software is not installed on the test machine. If the check fails, I have a task set to run that will install the software, that task just sits with "Synced with Agent", "Awaiting output", "Has not run yet" even though the schedule is set to "Every time check fails" and the "Assigned Check" is the script check that is in failed status. My script check for the software is here: https://ghostbin.com/QdWNE ("Software Name Here" is the name of my program in Programs and Features, verified it returns codes correctly depending on whether software is installed)
The "Script Output" returns 1 as expected, just the task never executes:
Last Run: Nov-18-2021 - 09:38
Run Time: 0.5215 seconds
Return Code: 1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the script check returns code 1, then the task will execute installing the software
Screenshots





@dinger1986 commented on GitHub (Nov 18, 2021):
was the check already in the failed state before you created the task?
@Layer-3s commented on GitHub (Nov 18, 2021):
It is possible, I created the task right after creating the check though and I'm not sure how to wait for the task before the check?
The check is set to go every "0" seconds which seems to be every minute, wouldn't the task have to run after every failed check?
Maybe 1 minute isn't long enough for the task to run?
@dinger1986 commented on GitHub (Nov 18, 2021):
I dont know but I cant replicate it.
I created a ping test going to 10.11.11.11 (which doesn't exist) and a task runs to check defender status if that fails,
I have done that and then changed the ping to another ip so it passes and then make it fail again and it works fine.
I also tried adding a task after it was already in a failed state and it ran fine.
Can you try it with a ping test? Maybe its the script check? Can you add the task into the check?
@Layer-3s commented on GitHub (Nov 18, 2021):
I'm able to run the built-in checks and tasks execute successfully on those, it appears to only be the script checks that are not working for me.
Are you saying can I add the software install into the check script? If so, I can and I'm sure that would work. Just was thinking this way might be more bullet proof as I can see if the task ran or not, but I guess I could script that part as well...
The task sits with "Awaiting Output", is there something else that's missing from my screenshots for the task to run?
@dinger1986 commented on GitHub (Nov 18, 2021):
I'll try script checks later on when I am back in front of my machine and see if I can replicate the bug then.
@Layer-3s commented on GitHub (Nov 18, 2021):
This was my fault... When copy-pasting my task script it looks like either myself or the computer removed a space in one of the arguments, adding the space resolved this.
Figured this out by trying to run the task manually (not through a script check, by right clicking the task and selecting "Run task now") in TacticalRMM, it still did not run successfully and said "Awaiting Output" after 10 minutes. Then tried running the script in PowerShell on my machine and received an error about the bad argument
Sorry for the false bug report lol, btw I'm loving this RMM, currently have it for testing for my company.
@dinger1986 commented on GitHub (Nov 18, 2021):
No worries.
Glad it's sorted!