mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #1992] Feature Request - Add dynamic variables for Scripts #3192
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#3192
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 @InfraCharm on GitHub (Aug 31, 2024).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1992
Is your feature request related to a problem? Please describe.
No. This is something I'd like to see so we can drop another piece of software we use in our stack.
Describe the solution you'd like
When setting up scripts, allow admins to set script argument or environment variable fields to be filled in when the script is ran from the RMM.
This feature would add more configurable options to script functionality in the RMM. An example is if you wanted to do a "Ping" script on Linux, you would add the "target" variable under dynamic variables and select if it's a script argument or environment variable. You would then right click the client and select "Run Script" and select the script as normal - but another screen shows up before the script runs asking you to fill in the "target" variable before the script is sent to the client for execution. This is best for configurations where things may change or you need to enter a license key - etc;
The variables should be able to be re-ordered or atleast configured to be in a specific order for script arguments.
Describe alternatives you've considered
We currently use script-server (https://github.com/bugy/script-server/) for similar functionality - would be cool if it was built into the panel and we can stop running extra software!
Additional context
Feel free to ask questions!
@ZzBombardierzZ commented on GitHub (Aug 31, 2024):
If I'm understanding correctly, I don't see the point or need of what you're asking for. Just use the "Run script" menu as it is and you can fill out the env variables or the script variables before you click run.
Alternatively, if you mean a dynamic/unique variable that goes to each agent (like agent 1 gets IP 8.8.8.8 but agent 2 should get 1.1.1.1), then use agent custom variables and then feed the {{agent.foobar}} into the script variable or env variable field.
If you need help making this work, Discord is very helpful. Please let me know if I'm way off here and misunderstood something.
@wh1te909 commented on GitHub (Aug 31, 2024):
this feature already exists, you can pass data to script via arguments or env vars. documentation here with video examples: https://docs.tacticalrmm.com/functions/scripting/
@InfraCharm commented on GitHub (Aug 31, 2024):
I think I might be lost here @ZzBombardierzZ. I'm trying to streamline the script process for my employees. Not all employees will know which script arguments go where and what the value should pertain to.
This would create custom fields in the script process essentially, prompting the person running the script to fill them out. This means there is less room for error.
Some scripts we run need 5-10 different arguments, keeping track of those with the way the RMM is a pain.
Quick Mockup:

@InfraCharm commented on GitHub (Aug 31, 2024):
Please review my last comment.
@ZzBombardierzZ commented on GitHub (Sep 1, 2024):
I agree that something to pop-up after clicking run script or after you choose the script to help you fill out "required" variables would make running scripts much easier for a general employee, with emphasis on "required". Not sure how it would look to implement such a thing, but it could display the required input variables into a list as you're showing.
However, I still don't see how that is a dynamic variable or what you mean exactly with that.
What I imagine you're trying to do with "dynamic variables" -and correct me if I'm still misunderstanding- is to have it use a specific value for each agent you try to run it on. If that is the intended goal, then using agent variables that are prefilled or with a default value that you can modify for any special cases may be easier for you.
Again, I may be totally misunderstanding, so if you can be more specific on what your end goal is that may help to see if there's a way to get to your goal without necessarily adding the variable menu example in the image.
@InfraCharm commented on GitHub (Sep 1, 2024):
I'm simply looking for a way to make custom fields for script arguments and environment variables, These would go in as the input for a script, not to be confused with custom fields when a script is finished running.
These aren't specific for each client, site, or agent - they are "dynamic" on runtime. This prompt in my photo would come up when actually preparing to run the script and get data for the script arguments in that example.
We already have a solution that works for this, as stated in a previous comment - I just wanted to see if we can get the same functionality in TRMM so we can drop more software from our stack.
@ZzBombardierzZ