[GH-ISSUE #1992] Feature Request - Add dynamic variables for Scripts #1246

Closed
opened 2026-03-02 02:22:06 +03:00 by kerem · 6 comments
Owner

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!

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!
kerem closed this issue 2026-03-02 02:22:07 +03:00
Author
Owner

@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.

<!-- gh-comment-id:2322946683 --> @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.
Author
Owner

@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/

<!-- gh-comment-id:2323048369 --> @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/
Author
Owner

@InfraCharm 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.

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:
image

<!-- gh-comment-id:2323049290 --> @InfraCharm 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. 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: ![image](https://github.com/user-attachments/assets/34f104d8-43a8-4110-90b7-e439584d3f48)
Author
Owner

@InfraCharm 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/

Please review my last comment.

<!-- gh-comment-id:2323060645 --> @InfraCharm 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/ Please review my last comment.
Author
Owner

@ZzBombardierzZ commented on GitHub (Sep 1, 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.

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:

image

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.

<!-- gh-comment-id:2323092028 --> @ZzBombardierzZ commented on GitHub (Sep 1, 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. > > > > 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: > > ![image](https://github.com/user-attachments/assets/34f104d8-43a8-4110-90b7-e439584d3f48) > > > > 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.
Author
Owner

@InfraCharm commented on GitHub (Sep 1, 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.

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:
image

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.

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

<!-- gh-comment-id:2323101834 --> @InfraCharm commented on GitHub (Sep 1, 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. > > > > > > 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: > > ![image](https://private-user-images.githubusercontent.com/157962730/363442102-34f104d8-43a8-4110-90b7-e439584d3f48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxNTM1MjEsIm5iZiI6MTcyNTE1MzIyMSwicGF0aCI6Ii8xNTc5NjI3MzAvMzYzNDQyMTAyLTM0ZjEwNGQ4LTQzYTgtNDExMC05MGI3LWU0Mzk1ODRkM2Y0OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwMVQwMTEzNDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YTk3ZGFlYWEzMTYyMjU3OGFhMTljOGE1ZDBmYmRkYmZlODBjMmM2ZGE5OGUwNjI1MzczNzA4NjE0ZWI4ZmE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.XKTcfyC9VkNe8IWnsmKleWn7pW8RHeUJCtUd7Bu9rq0) > > 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. 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
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#1246
No description provided.