vCenter notification send push message using Prowl to iOS devices

Categories: Homelab, Scripts, VCSA, Virtualisation, VMware, vSphere

I would like to receive push messages for triggered alerts from my vCenter. There is the possibility to execute a command when a alert has been triggered so I decided to write a script which will use Prowl to send push notification to my mobile apple device. I used Prowl already for other devices like […]

Get all guest IPs of all your Virtual Machines using Powershell

Categories: Scripts, Uncategorized, VMware, vSphere

This is a small powershell script to get all Guest IPs from all virtual machines $VCENTER=”10.1.1.3″ Connect-VIServer -Server $VCENTER $vms = Get-VM | Sort $file = “c:\ip_list.txt” foreach ($vm in $vms){ foreach($ip in $vm.Guest.IpAddress){ Write-Host “$vm $ip” “$vm $ip” | Out-File -FilePath $file -Append } } Disconnect-VIServer -Server $VCENTER -Confirm:$false -Force:$true

Upload file to webdav using Powershell

Categories: PowerShell, Scripts

This is small powershell script to upload a file from your local disk to a webdav server. It is also proxy capable. #Complete path of the file to be uploaded $file = “d:\test_file.txt” #URL without the last “/” $url = “https://YOUR-SERVER/webdav” $proxy = “http=PROXY-SERVER:PORT” #User and Pwd for Webdav Access $user = “USERNAME” $pass = […]

Monitor System Logs with Logwatch

Categories: Scripts, Tools, Ubuntu

I’m using the tool Logwatch to get a daily log report from all my servers by email. Install Logwatch: apt-get update apt-get install logwatch Config file: /usr/share/logwatch/default.conf/logwatch.conf To simplify the access to the config file I use a symlink. cd /etc/logwatch ln -s /usr/share/logwatch/default.conf/logwatch.conf Configuration (parameters which I have changed): #Output = stdout Output = […]

Change HA settings for virtual machines using Powershell

Categories: PowerShell, Scripts, VMware, vSphere

Using this small script it is possible to change the HA settings for multiple virtual machines in an HA cluster. Example: – multiple virtual machines all with Name XXX-console HA restart policy possible values: -HARestartPriority:Low -HARestartPriority:High -HARestartPriority:Disabled -HARestartPriority:Medium -HARestartPriority:ClusterRestartPriority Connect-VIServer -Server VCENTER-IP -User USER -Password PASSWORD $Cluster = “CLUSTERNAME” $vms = Get-VM -Location $Cluster -Name […]

Configure local syslog folder on all your ESXi servers

Categories: ESXi, PowerShell, Scripts, Virtualisation, VMware, vSphere

######################################################################################################## # Steps to use the script: # # 1st: create a folder on an shared datastore # # 2nd: adjust the content of the variable $FolderName to the name of the folder created in step 1 # # 3rd: adjust the content of the variable $datastore to the name of the shared datastore # […]

VMware Tools Status report

Categories: PowerShell, Scripts, theVESI, Virtualisation, VMware, vSphere

Script to create a report about the VMware Tools status: Sample Output: Total VMs: 527 Total powered on: 474 Total powered off: 53 ToolsOK: 140 ToolsOld: 227 ToolsNotInstalled: 106 DisConnect from Virtual Center Set-PSDebug -Strict $VIServer = “VCENTERIP” Connect-VIServer -server $VIServer -User USERNAME -Password PASSWORD $vms = Get-VM | Sort Name $on = 0 $toolsOk […]