Posts

Showing posts with the label Nagios Core

Export VMware data directly into Nagios

I ran into an issue the yesterday.  In our environment there is NO budget for deploying an enterprise class monitoring solution.  In this case the team had chosen to deploy Nagios.  Nagios is a pretty robust tool, but limited in what you can do on the web interface.  In addtion we had 200+ VM's that had yet to be added.  There are some handy web UI tools to manage the configuration scripts, but who has time for that.  I whipped up this handy PowerCLI script to pull all the live VM data from VCenter and export that data into a .CFG file ready for Nagios Core to use.  Feel free to download and share. You can copy and paste this right into your powerCLI interface once you connect to your VI Server. #Export VM Info into Nagios Ready Configuration Files $VMInfo = Get-Cluster "BladeServers" | get-vm | Select Name, @{N="IP Address";E={@($_.guest.IPAddress[0])}},PowerState New-Item c:\temp\windowsVms.cfg -ItemType file foreach ($vm in $VMInfo){ $os = get-vm $vm