Configuration Performance Script Testing Troubleshooting

SCOM 2012 R2 – PowerShell To Determine Agent Required Disk Space

Do you use any of the System Center products which use an agent? SCOM is one of these products which needs to have an agent installed on the monitored systems. But do you know how much space an agent really uses? Why is this important? Well, let’s assume you have to monitor an older operating system like Windows Server 2003 SP2 (sorry yeah I know, I wrote in my last post, that I will blog about future technologies…) which by the way SCOM 2012 R2 is capable of. In that case, older servers running these legacy operating systems are mostly on their limit, especially if those server are physical and not virtualized. Another example why it is important to know how match space the agent requires, you might have a virtual machine in the cloud and because storage is expensive, you need to size your disks properly so you don’t waste any money. If you try to find any accurate values in the documentation from Microsoft you will be lost. Because of all that I decided to make a small test, which you also could reproduce in your lab.

If you have already played with SCOM 2012 R2 you know that the agents are located in C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\AgentManagement and if you look at the size of the directory e.g. amd64 agent directory you will see that the agent is approx. 34 MB. There are some transform files included which not all apply but for our test it is accurate enough…

image

For our test I have a plain SCOM 2012 R2 management server scom2012R2.contoso.com  up and running WITHOUT any additional management packs installed. What happens if I just deploy the plain SCOM 2012 R2 agent to a server? How much space will the agent require?

Good question, so let’s see…

Update 04.01.2014: I ran the test multiple times trying to get the most accurate values possible. I think I have now a pretty good test result. I updated the screenshots and results in this post accordingly. If you want to reproduce these tests, make sure you turn off automatic updates, if it is a virtual machine set the memory to fixed and turn off all other things which could influence the disk space!

For this small test I have written some PowerShell code that will get the free disk space of the server which will be monitored by the agent. In addition I am getting the size of the C:\Program Files\Microsoft Monitoring Agent directory where the agent is installed.

The PowerShell script looks like this…

image

Basically I have created two functions which get the free disk space and folder size on a remote system, in my case a domain controller dc.contoso.com. Then I call these function before and after SCOM agent installation. Next, the script every minute the disk space and C:\Program Files\Microsoft Monitoring Agent folder size. There are different ways of getting these information. I would like to point out the Get-Volume cmdlet which is new in PowerShell 4.0 and provides easily the remaining disk space info.

Ok let’s run the script on the SCOM 2012 R2 management server …

image_thumb4

image4_thumb

Wow, if you look at these numbers! As you can see the agent has approx. 10-times the size you would expect from the installation directory. The size on the disk starting from 347 MB and growth up to 381 MB WITHOUT any additional  management packs installed. The SCOM agent directory increased from initially 311 MB up to 340 MB.

Ok, what happens if you install a management pack? For our test I will install Windows Server 2012 R2 Core MP and it’s dependencies…

image

First uninstall the agent from the domain controller dc.contoso.com, reboot the server and run the script again after the management pack installation…

image

image_thumb[4]

The size on the disk starts from 347 MB and growth up to 387 MB with one management pack installed. The SCOM agent directory increased from initially 311 MB up to 347 MB.

Conclusion: Although there is some inaccuracy involved due to processes on the monitored system itself, we can clearly see a trend. Don’t get fooled by the size of the installation directory on the management server which shows an agent size of ~34 MB. The effective size on the monitored server takes  ~381 MB on a domain controller without any additional management packs installed. If you install management packs this number can even grow higher. In this example the SCOM agent directory increased with Windows Server 2012 R2 Core MP and it’s dependencies to ~7 MB.

So, if you have any older server in your environment which have not much free disk space be careful before you deploy any agents to those systems. Even if you order a virtual machine consider enough space for the SCOM or other System Center agents which need to be deployed.

If you are interested in the script you can download it from TechNet Gallery.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.