mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #1144] Monitor/Script output/return information #2647
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#2647
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 @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:
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/
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)@silversword411 commented on GitHub (May 18, 2022):
Use
Write-Output@mrinc commented on GitHub (May 18, 2022):
@silversword411 Got an example to set variables? since
Write-Outputjust outputs data@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'sWrite-Output $variableorWrite-Output "Variable: $variable"https://github.com/amidaware/community-scripts/blob/main/scripts/Win_Hardware_RAM_Status.ps1
@silversword411 commented on GitHub (May 18, 2022):
Sometimes you need to escape...so it's
Write-Output "Error with Code $($code)!"@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
@silversword411 commented on GitHub (May 18, 2022):
@mrinc Where did you look in the docs for that info, so I can put it there :)
@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)