Home > Blogs > VMware PowerCLI Blog


VI Toolkit Demos at VMworld Europe 2009 (Part 1 of 2: Network Monitoring)

We did two live demos as part of VI Toolkit’s breakout session at VMworld Europe 2009. This post is about the first demo which featured some network configuration monitoring and Carter’s cell phone beeping loudly when he received the alert emails…


So, you’re a VI system administrator and you have a policy that no VM can be simultaneously connected to the Intranet and the DMZ. With all the configuration changes going on, it would be nice if a script could monitor the network and drop you an email when some change breaks the policy.


With VI Toolkit stuff like this is pretty easy. How about getting all VMs and then examining each one’s network configuration? Sounds about right but it could be a bit slow if you have a large number of VMs. Let’s tweak it a bit by first looking at the Virtual Center’s even log. Filter only events which show that a VM’s network was reconfigured. Then go check only those VMs.


You want a script which runs the check repeatedly until you stop it. So, each time, it needs to look only at the events, created since the last check. And with PowerShell’s native access to .Net library, sending email is a piece of cake.


Finally, here’s the script itself (you need to be connected before you run it):


2 thoughts on “VI Toolkit Demos at VMworld Europe 2009 (Part 1 of 2: Network Monitoring)

  1. LucD

    Any idea when we can expect part 2 ? It was a great demo and I would surely like to see the code 😉

    Reply
  2. Andrey Anastasov

    @LucD, Any day now 🙂
    I’ve been tied on new features lately but it really is about time I wrote the second part. Let’s not call it a promise but I plan to post it tomorrow.

    Reply

Leave a Reply

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

*