“Hello, is it IT support? My Internet is slow”
Have you heard that before? Last week a customer asked me if we could monitor how long it takes to download a file from a client workstation, and present it in a nice performance view in the Operations Manager console. Of course we can, with a script in a rule. The script downloads a file from Internet, measure the time it takes and reports it back to Operations Manager as performance data. You can control which machines that runs the script, so you cant select some workstations or machines in remote offices. If it takes more then 3 seconds it will generate a local event. If there is a problem downloading the file it will also generate a local event. You can configure Operations Manager to pickup this event and generate an alert. Thanks to Patrik the script can detect if the file we are trying to download is missing or if there are any other download related problems. I have attached the script I used, and below is the steps that you need to take to implement it.
To use this script, follow these steps
- In the Operations Manager console, navigate to the Authoring workspace, right-click Rules and select Create New Rule
- In the Create Rule Wizard, select to create a Probe Based/Script (Performance) rule, select a suitable management pack for example Contoso – Internet Download
- On the Rule Name and Description page, input a rule name for example “Contoso – Internet Download – Download 20 Mb file”. Select a suitable target for example Windows Server. Uncheck the “Rule is enabled” box.
- On the Schedule page, input how often you want to script to run. For example every 10 minutes
- On the Script page, clear the script text box and paste the script from the attached file. Configure the timeout to 5 minutes. Change the script name to ContosoDownloadscript.vbs
- On the Performance Mapper page, input
- Object: 20MB.zip
- Counter: FileDownload_Time
- Instance: select Netbios computer name from the menu
- Value: $Data/Property[@Name=’Contoso_PerfValue’]$
- Create the rule
Now you have a rule target to all Windows Servers. But it is disabled. To control which machine that is running this, create a new group, save it in the same management pack (important!) and add some windows servers as explicit members. These machines will run the script and download the file.
- In the Operations Manager console, navigate to the Authoring workspace, right-click Groups and select Create a new Group
- In the Create Group Wizard, input a group name, for example “Contoso – Internet Download nodes”. Select the same management pack as you used before, in my case Contoso – Internet Download
- On the Explicit Member page, click Add/Remove Objects
- In the search for drop down menu, select Windows Server. Then in the name field input the machine or machines that you want to use as watcher node and add then under selected objects
- Click next a couple of times in the wizard and then save and close it
To enable the rule against the machines in this group,
- Find the rule again under Authoring and rules
- Right-click it and select Overrides, Override the Rule, For a group, select your group
- In the Override properties window, select enable and configure the override value to TRUE. Click OK to save.
The next step will be to configure a rule to pickup the event. These are the two events that you want to generate alert on
- Navigate to Authoring workspace, right-click Rules, select Create a new rule…
- In the Create Rule Wizard, select to create a Alert Generating Rule, Event Based, NT Event Log (Alert). Select the same MP again, in my case Contoso – Internet Download
- On the General page, input a name, for example Contoso – Internet Download – Event rule. Select “Windows Server” as rule target. Uncheck the “Rule is enabled” check box
- On the Event Log Type page, select Application
- On the Build Event Expressen, input
- Event ID Equals 2
- Event Source Equals WSH
- On the Configure Alerts page, click Alert suppression…
- In the Alert Suppression window, select Event ID, Logging Computer, Event Source, click OK
- On the Configure Alerts page, click Create
Now we need to enable this for the machines that we use as watcher nodes. As we created this rule with “Rule is enabled” unchecked, no machines is running it right now.
- Find the rule again under Authoring and rules
- Right-click it and select Overrides, Override the Rule, For a group, select your group
- In the Override properties window, select enable and configure the override value to TRUE. Click OK to save.
The last step could be to create the performance view
- In the console, navigate to the Monitoring workspace
- Select the folder for your MP, in my case “Contoso – Internet download”. Right-click it and select New > Performance View
- In the Properties window input
- Name: Contoso -Â Download speed
- Show data contained in a specific group: Select your group, in my case “Contoso – Internet download nodes”
- Object: 20MB.zip
- Counter: FileDownload_Time
- Click Ok to save you diagram view
If you want to change the file that we download, or the destination folder, you need to modify the script and the lines highlighted below
If you want to change the default 5 seconds threshold on the download, you need to modify the following line
Download the script here, Internetdownload
Hi,
This is very helpfull for me.
This script is working fine to get internet downloading performance from the remote windows server 2012 or 2008. But downloading performance is very slow for the remote windows 7 machine Do you have any idea on this?
Go to Channel 9 and Search for Orchestrator, there you will find alot of good information.
I would like to know more about Orchestrator and its features. Is there any websites available to compare the features. And I would like to know the uniqueness of Orchestrators because we are planning to start a service automation company where we automate the IT Services and Operations. This information will be helpful if you provide.
[…] Monitor the internet connection as a client « http://www.contoso.se […]
If you need that you could use the web application template inside of operations manager. that can handle login/password and measure performance in a number of ways.
Hi Anders,
Great article. It covers a requirement I have to address at my own workplace.
One thing that I would like to ask is how to pass a username and password in the script since the particular site I would like to apply this performance monitor to is an internal site.
As I am not skilled in scripting any suggestions in how to adapt the script to pass the username and password parameters to an internal site would be greatly appreciated.
Once again, thanks for the great posting.
Regards,
Michael
thank you for this information, now it works.
Now i have just a look, how can i set the threshold of timer from outside of the script.
thx
If you want to use a proxy in the connection you need to use a newer version of the Microsoft.XMLHTTP. Starting from version 4.0 you should be able to specify a proxy server and authentication information.
Hi, I asked Patrik to look into it, will see what the comes up with. Else send him a e-mail at patrik AT litware DOT se
Hi,
any other ideas?
Yes, IE can access the URL.
I tested it with an internal URL, everything was fine.
Can IE on the same machine access the URL in the script?
Hi,
very good example, very helpfull.
Short question.
My actual error message is “Problem with URL”.
We are using a proxy.
Are there any settings to keep in mind?
Greetings Frank