Categories
Monitoring Scripts VCSA VMware

Update: Trigger a User event from the VCSA command line

Disclaimer: This is not officially supported by VMware, please use at your own risk. Recently I faced the challenge with a script running on a VCSA which executes some checks and in case something gets detected it has to trigger a vCenter alarm. My solution is to log a user event which will be captured […]

Categories
Homelab Scripts VCSA Virtualisation VMware vSphere

vCenter notification send push message using Prowl to iOS devices

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 […]

Categories
Scripts Uncategorized VMware vSphere

Get all guest IPs of all your Virtual Machines using Powershell

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

Categories
PowerShell Scripts

Upload file to webdav using Powershell

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 = […]

Categories
Scripts Tools Ubuntu

Monitor System Logs with Logwatch

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 = […]

Categories
ESXi PowerShell Scripts VMware vSphere

Collect ESXi stats with powershell and send it to Graphite server

I was not quite happy with the statistics from the vCenter. It is not possible to get an overview overall my ESXi servers. :-( Someone pointed me to the tool Graphite that this is a cool solution to visualize such kind of statistics. So I decided to give it a try. I created and virtual […]

Categories
ESXi Homelab HP Ideas PowerShell Scripts VMware vSphere

HomeLab and nested ESXi server

After an short weekend with a minimal of sleep … I’m done my Homelab is up and running. Furthermore I have created an template of an nested ESXi (virtualized ESXi). These nested ESXi are perfect for testing of Powershell scripts which I use to initial configure an new ESXi. Next steps which I have planned […]

Categories
PowerShell Scripts VMware vSphere

Change HA settings for virtual machines using Powershell

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 […]

Categories
ESXi PowerShell Scripts Virtualisation VMware vSphere

Configure local syslog folder on all your ESXi servers

######################################################################################################## # 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 # […]

Categories
PowerShell Scripts theVESI Virtualisation VMware vSphere

VMware Tools Status report

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 […]