[GH-ISSUE #668] Script checks are not triggering Tasks to run #425

Closed
opened 2026-03-02 02:16:15 +03:00 by kerem · 8 comments
Owner

Originally created by @technoicon on GitHub (Aug 29, 2021).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/668

Server Info (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser: Chrome
  • RMM Version (as shown in top left of web UI): 0.7.2

Installation Method:

  • Docker

Agent Info (please complete the following information):

  • Agent version: Agent v1.5.9
  • Agent OS: Windows 7 Professional, 32 bit (build 7601.24546)

Describe the bug
I have a few checks setup that trigger tasks if they fail. A few examples are:
Power shell version < 2 - Triggers powershell upgrade script.
Traylauncher installed - Triggers tray launcher install script.
AV installed check - Triggers AV installation.
I have checked a few machines for one client and it seems that the checks are failing but the tasks are not triggering. I can run them Manually and they work.

To Reproduce
Steps to reproduce the behavior:

  1. Create a policy.
  2. Create a check
  3. create a task that executes on the check failure.

Expected behavior
Expect the tasks to trigger or error.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Originally created by @technoicon on GitHub (Aug 29, 2021). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/668 **Server Info (please complete the following information):** - OS: Ubuntu 18.04 - Browser: Chrome - RMM Version (as shown in top left of web UI): 0.7.2 **Installation Method:** - [ ] Docker **Agent Info (please complete the following information):** - Agent version: Agent v1.5.9 - Agent OS: Windows 7 Professional, 32 bit (build 7601.24546) **Describe the bug** I have a few checks setup that trigger tasks if they fail. A few examples are: Power shell version < 2 - Triggers powershell upgrade script. Traylauncher installed - Triggers tray launcher install script. AV installed check - Triggers AV installation. I have checked a few machines for one client and it seems that the checks are failing but the tasks are not triggering. I can run them Manually and they work. **To Reproduce** Steps to reproduce the behavior: 1. Create a policy. 2. Create a check 3. create a task that executes on the check failure. **Expected behavior** Expect the tasks to trigger or error. **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here.
kerem 2026-03-02 02:16:15 +03:00
  • closed this issue
  • added the
    bug
    fixed
    labels
Author
Owner

@dinger1986 commented on GitHub (Aug 30, 2021):

Has this been tested on supported os's? IE Ubuntu 20.04 and windows 10?

<!-- gh-comment-id:907943232 --> @dinger1986 commented on GitHub (Aug 30, 2021): Has this been tested on supported os's? IE Ubuntu 20.04 and windows 10?
Author
Owner

@silversword411 commented on GitHub (Aug 30, 2021):

What powershell <2 script are you using? If it's reliable, mind sharing so I can get it in the community script library?

<!-- gh-comment-id:908198009 --> @silversword411 commented on GitHub (Aug 30, 2021): What powershell <2 script are you using? If it's reliable, mind sharing so I can get it in the community script library?
Author
Owner

@technoicon commented on GitHub (Aug 30, 2021):

yeah sure
check powershell Version:

if ($PSVersionTable.PSVersion.Major -gt 2)
{
    $PSVersionTable.PSVersion.Major
    Write-Output "PSVersion Greater than 2.0"
    exit 0
}
else
{
    $PSVersionTable.PSVersion.Major
    Write-Output "PSVersion less than 2.0"
    exit 1
}

Then if fails < 2.0


#save this file and self-host https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7AndW2K8R2-KB3191566-x64.zip

if ($PSVersionTable.PSVersion.Major -lt 5)
{
    Write-Output "Old Version - Need to Upgrade"
    # Download MSU file - EDIT THIS URL
   # $url = "www.mustuploadtoyourownsite.com"
    (new-object System.Net.WebClient).DownloadFile($url,'C:\temp\Win7AndW2K8R2-KB3191566-x64.msu')

    ## Run upgrade process
    start-process -FilePath "c:\windows\system32\wusa.exe" -ArgumentList "c:\temp\Win7AndW2K8R2-KB3191566-x64.msu /quiet /norestart /log:c:\temp\log.evt"
    Write-Output "Run upgrade process"
}
else
{
    Write-Output "Already at 5.0 or Higher"
}

reliable... well yeah, i'll leave that up to you.

<!-- gh-comment-id:908340691 --> @technoicon commented on GitHub (Aug 30, 2021): yeah sure check powershell Version: ``` if ($PSVersionTable.PSVersion.Major -gt 2) { $PSVersionTable.PSVersion.Major Write-Output "PSVersion Greater than 2.0" exit 0 } else { $PSVersionTable.PSVersion.Major Write-Output "PSVersion less than 2.0" exit 1 } ``` Then if fails < 2.0 ``` #save this file and self-host https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7AndW2K8R2-KB3191566-x64.zip if ($PSVersionTable.PSVersion.Major -lt 5) { Write-Output "Old Version - Need to Upgrade" # Download MSU file - EDIT THIS URL # $url = "www.mustuploadtoyourownsite.com" (new-object System.Net.WebClient).DownloadFile($url,'C:\temp\Win7AndW2K8R2-KB3191566-x64.msu') ## Run upgrade process start-process -FilePath "c:\windows\system32\wusa.exe" -ArgumentList "c:\temp\Win7AndW2K8R2-KB3191566-x64.msu /quiet /norestart /log:c:\temp\log.evt" Write-Output "Run upgrade process" } else { Write-Output "Already at 5.0 or Higher" } ``` reliable... well yeah, i'll leave that up to you.
Author
Owner

@technoicon commented on GitHub (Aug 30, 2021):

As far as i'm aware ubuntu 18.04 is supported, that's why I'm using it.

Yes, same problem with windows 10 machines.

see attached.
check failed
task never triggered
winversion

<!-- gh-comment-id:908345221 --> @technoicon commented on GitHub (Aug 30, 2021): As far as i'm aware ubuntu 18.04 is supported, that's why I'm using it. Yes, same problem with windows 10 machines. see attached. ![check failed](https://user-images.githubusercontent.com/17463110/131346819-3a8cb9e6-faff-423e-aa3a-d2e1a1a9784c.png) ![task never triggered](https://user-images.githubusercontent.com/17463110/131346825-7043036f-7581-43e7-a774-f21f135deb14.png) ![winversion](https://user-images.githubusercontent.com/17463110/131346827-e594c101-946e-4b5d-a8c6-30338986698d.png)
Author
Owner

@silversword411 commented on GitHub (Aug 30, 2021):

yeah sure

Ok, that looks familiar. Already got it in the wip...but since it requires manual hosting of files it's not in official library yet.

I did add a bunch of other URL's to the comments for other versions. Probably could be enhanced to detect OS, and then download directly from Microsoft instead :)

<!-- gh-comment-id:908434312 --> @silversword411 commented on GitHub (Aug 30, 2021): > yeah sure Ok, that looks familiar. Already got it in the wip...but since it requires manual hosting of files it's not in official library yet. I did add a bunch of other URL's to the comments for other versions. Probably could be enhanced to detect OS, and then download directly from Microsoft instead :)
Author
Owner

@wh1te909 commented on GitHub (Sep 5, 2021):

confirmed bug, am able to reproduce. for now solution is to create the check/task on the agent level, not with automation manager, until we get this fixed.

<!-- gh-comment-id:913106871 --> @wh1te909 commented on GitHub (Sep 5, 2021): confirmed bug, am able to reproduce. for now solution is to create the check/task on the agent level, not with automation manager, until we get this fixed.
Author
Owner

@wh1te909 commented on GitHub (Sep 5, 2021):

fixed in github.com/wh1te909/tacticalrmm@181891757e
tasks with schedule "run on check failure" were not being created at all when applied via a policy, so on next release you'll need to recreate them

<!-- gh-comment-id:913219734 --> @wh1te909 commented on GitHub (Sep 5, 2021): fixed in https://github.com/wh1te909/tacticalrmm/commit/181891757e88082ded5cbab9cf389570c9f9cee8 tasks with schedule "run on check failure" were not being created at all when applied via a policy, so on next release you'll need to recreate them
Author
Owner

@wh1te909 commented on GitHub (Sep 6, 2021):

fixed in release 0.8.3

<!-- gh-comment-id:913502383 --> @wh1te909 commented on GitHub (Sep 6, 2021): fixed in release 0.8.3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#425
No description provided.