So you probably know that ControlUp is an amazing piece of software when it comes to monitoring the performance of your environment. But did you know that it can do a lot more ? A great example of this is script-based actions, which allows you to run scripts on any object that you are monitoring. In this blog I will show you how to use the script-based actions and create your own.
So what are Script-Based Actions exactly?
A script-based action is a PowerShell, VBS, or CMD script that you can use just like any other ControlUp contextual management action. ControlUp comes with a community script-based action “store” with a lot of great scripts that you can leverage. You can also create your own script-based action use them internaly in your organization and /or upload them to the community to share with others.
How do you use Script-Based Actions?
Using a script-based action is easy, all you need to do are the following steps:
1. Click on the Script-Based Actions button in the General Section:
2. Now the community script-based actions open up, here you can search for the script you want. In my example I’m going to search for the script-based actions which will show you the usages of your PVS cache by Matthew Nichols. So I search for PVS and click on Add Script.
3. Next ControlUp will show a screen with more information about the script. Check the I accept the terms of.. box and click on Add Action.
4. Thats it! The script is installed. Now how to run the script on a target?
5. Because the script-based action we selected check the PVS cache size we of course need to run it on a Citrix PVS target machine. So I selected my XenApp server. Then click right mouse and there you will see Script Based Actions. When you unfold the menu you can see the action we just added. Click on the action to run it.
6. So now the action has run and here you can see the results.
And that’s how script-based actions work! Now what if you want to run your own scripts?
Create your own Script-Based Action!
You probably have a script repository of your own that you would like to run.This is the most awesome part because you can use ControlUp as your script repository and easily run scripts on hosts. So here are the steps to create your own Script-Based action.
1. First we need a script that we can run on a host. I created a small PowerShell script that checks the size and path of the Ivanti Workspace Control DB Cache folder. It also checks if the transaction folder is empty.
2. Now that we have our script we can add it to ControlUp script-based actions. Go to script-based actions and select the My Draft Actions tab and click on New.
3. Give your script-based action a name, description and optionally an icon.
4. Select on what kind of item you can run the script and the exception and security context.
5. Paste your script in the Script: section and select the correct type.
6. If your script requires arguments you can add them. When running the script-based action you will be prompted to enter the arguments. My script doesn’t require any arguments so I keep this empty.
7. Now your script-based action is saved in draft and you can test it on a host.
8. Now we can test the script by running it on a host with Ivanti Workspace Control Installed.
9. Now that we see the correct results we can finalize the script-based action. This way your whole organization can use the scripts and optionally the community too. Go back to script-based actions and to my drafts and click on finalize.
10. Fill in the last information on who created the script etc. and click OK.
Thats it ! Now you created your first script-based action.
I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me: