Monitoring ESXi RAMDisks with Powershell

Monitoring ESXi RAMDisks with Powershell

Hosts disconnected?
Check your Ramdisks!
‘But how?’ I hear you ask?
Why here’s a little Powershell script to do just that!



With everything that a vAdmin needs to keep on top of in terms of monitoring and metrics, the ESXi Ramdisks can often get overlooked.  You should look to avoid this trap however as a full Ramdisk can lead to a host of problems (pun most definitely intended).

Fear not, here’s a Powershell script to keep an eye on things for you, and it will even send you an email if Ramdisk utilization exceeds the threshold you set.

Now this script assumes that you’ve already installed the latest version of the PowerCLI cmdlets from the Powershell gallery but if you haven’t, this post from Kyle Ruddy describes the process. In addition to Kyle’s post if you find you don’t have the right version of Powershell to speak to the gallery you can grab it here.  Or if you’re happy with your version but just want the required modules, grab them here.

Not one to be outdone by the likes of Columbo, there’s just one more thing.  This script currently has the vCenter credentials in plain text as variables within the script, for use in production environments I’d suggest tweaking it to use the Credential Store as a more secure way of connecting to your vCenter instance- see here for a guide to the commands.

So here’s the script, enjoy and I hope it proves useful- set by default to alert at 90% utilization but you can tailor this as required.  Set it to run as a scheduled task at your desired frequency and relax!




Related posts