[GH-ISSUE #1144] Monitor/Script output/return information #705

Closed
opened 2026-03-02 02:18:24 +03:00 by kerem · 7 comments
Owner

Originally created by @mrinc on GitHub (May 18, 2022).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1144

Is your feature request related to a problem? Please describe.
Not a problem, and I cannot find any docs on it, so if it doesn't exist - it will be a really awesome feature to make flexible scripts/monitors.

Describe the solution you'd like
When a monitor/script is run on a device, there should be some sort of way to return data back to Tactical.

Describe alternatives you've considered
N/A

Additional context
An example would be reading the output of the script and just parsing the response lines.

And example of this would be:

echo "##tactical[<messageName> 'value']"  
Write-Host "##tactical[<messageName> 'value']"  

The use case could be as simple as reporting internet speed test information or latency to a server.

/pings or does speed test to server/

echo "##tactical[SPEEDTEST_DOWN '10']"  
echo "##tactical[SPEEDTEST_UP '10']"  
echo "##tactical[SPEEDTEST_LAT '1']"  

That could then set variables/attributes on the device on tactical (https://docs.tacticalrmm.com/script_variables/)
So create a variable in tactical of type writable (so the scripts/monitors) could output the information back to tactical - but other variables would not be able to overwrite them - also means minimal additional development.

And if you have a monitor, could trigger based on when the variable goes out of spec.

Datto does it with NAME=VALUE (https://rmm.datto.com/help/en/Content/4WEBPORTAL/Monitor/CustomComponentMonitor.htm)

Originally created by @mrinc on GitHub (May 18, 2022). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1144 **Is your feature request related to a problem? Please describe.** Not a problem, and I cannot find any docs on it, so if it doesn't exist - it will be a really awesome feature to make flexible scripts/monitors. **Describe the solution you'd like** When a monitor/script is run on a device, there should be some sort of way to return data back to Tactical. **Describe alternatives you've considered** N/A **Additional context** An example would be reading the output of the script and just parsing the response lines. And example of this would be: ```bash echo "##tactical[<messageName> 'value']" ``` ```powershell Write-Host "##tactical[<messageName> 'value']" ``` The use case could be as simple as reporting internet speed test information or latency to a server. /pings or does speed test to server/ ```bash echo "##tactical[SPEEDTEST_DOWN '10']" echo "##tactical[SPEEDTEST_UP '10']" echo "##tactical[SPEEDTEST_LAT '1']" ``` That could then set variables/attributes on the device on tactical (https://docs.tacticalrmm.com/script_variables/) So create a variable in tactical of type writable (so the scripts/monitors) could output the information back to tactical - but other variables would not be able to overwrite them - also means minimal additional development. And if you have a monitor, could trigger based on when the variable goes out of spec. Datto does it with `NAME=VALUE` (https://rmm.datto.com/help/en/Content/4WEBPORTAL/Monitor/CustomComponentMonitor.htm)
kerem closed this issue 2026-03-02 02:18:24 +03:00
Author
Owner

@silversword411 commented on GitHub (May 18, 2022):

Use Write-Output

<!-- gh-comment-id:1130078511 --> @silversword411 commented on GitHub (May 18, 2022): Use `Write-Output`
Author
Owner

@mrinc commented on GitHub (May 18, 2022):

@silversword411 Got an example to set variables? since Write-Output just outputs data

<!-- gh-comment-id:1130079746 --> @mrinc commented on GitHub (May 18, 2022): @silversword411 Got an example to set variables? since `Write-Output` just outputs data
Author
Owner

@silversword411 commented on GitHub (May 18, 2022):

Maybe I'm not understanding what you're asking.

If you want to return data from a powershell script use Write-Output "Some text". If you want to output data from a script it's Write-Output $variable or Write-Output "Variable: $variable"

https://github.com/amidaware/community-scripts/blob/main/scripts/Win_Hardware_RAM_Status.ps1

2022-05-18_103318 - brave_Tactical_RMM_-_Brave

<!-- gh-comment-id:1130097617 --> @silversword411 commented on GitHub (May 18, 2022): Maybe I'm not understanding what you're asking. If you want to return data from a powershell script use `Write-Output "Some text"`. If you want to output data from a script it's `Write-Output $variable` or `Write-Output "Variable: $variable"` https://github.com/amidaware/community-scripts/blob/main/scripts/Win_Hardware_RAM_Status.ps1 ![2022-05-18_103318 - brave_Tactical_RMM_-_Brave](https://user-images.githubusercontent.com/13395348/169067277-894ef0de-5dd6-47e1-8de8-fed58379ee15.png)
Author
Owner

@silversword411 commented on GitHub (May 18, 2022):

Sometimes you need to escape...so it's Write-Output "Error with Code $($code)!"

<!-- gh-comment-id:1130099414 --> @silversword411 commented on GitHub (May 18, 2022): Sometimes you need to escape...so it's `Write-Output "Error with Code $($code)!"`
Author
Owner

@mrinc commented on GitHub (May 18, 2022):

@silversword411 Shot

Okay so the docs need to just be updated with some more info :)

Awesome!

Nice and simple like Datto sweet

<!-- gh-comment-id:1130123903 --> @mrinc commented on GitHub (May 18, 2022): @silversword411 Shot Okay so the docs need to just be updated with some more info :) Awesome! Nice and simple like Datto sweet
Author
Owner

@silversword411 commented on GitHub (May 18, 2022):

@mrinc Where did you look in the docs for that info, so I can put it there :)

<!-- gh-comment-id:1130180136 --> @silversword411 commented on GitHub (May 18, 2022): @mrinc Where did you look in the docs for that info, so I can put it there :)
Author
Owner

@wh1te909 commented on GitHub (May 18, 2022):

use a collector task with custom fields, see https://docs.tacticalrmm.com/functions/custom_fields/ (video walkthru at bottom of page)

<!-- gh-comment-id:1130235356 --> @wh1te909 commented on GitHub (May 18, 2022): use a collector task with custom fields, see https://docs.tacticalrmm.com/functions/custom_fields/ (video walkthru at bottom of page)
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#705
No description provided.