{"id":350,"date":"2019-06-19T20:55:01","date_gmt":"2019-06-19T12:55:01","guid":{"rendered":"https:\/\/kylemcdonald.com.au\/?p=350"},"modified":"2019-07-27T20:30:17","modified_gmt":"2019-07-27T12:30:17","slug":"finding-esxi-hosts-with-ip-conflicts","status":"publish","type":"post","link":"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/","title":{"rendered":"Finding ESXi hosts with IP conflicts"},"content":{"rendered":"
I recently had a client with some ESXi hosts having intermittent issues with NFS storage. After checking vmkernel.log (and confirming via vodb.log) I found that these hosts were reporting IP conflict errors. Someone bought extra drinks that night!<\/p>\n
The following PowerCLI script will help check \/var\/log\/vmkernel.log on each ESXi host in a cluster. You can find it on GitLab<\/a>.<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" I recently had a client with some ESXi hosts having intermittent issues with NFS storage. After checking vmkernel.log (and confirming via vodb.log) I found that these hosts were reporting IP conflict errors. Someone bought extra drinks that night! The following Continue reading Finding ESXi hosts with IP conflicts<\/span><#\r\n.SYNOPSIS\r\n Script to find IP conflicts on your ESXi hosts.\r\n\t\r\n.DESCRIPTION\r\n This script will enumerate all hosts in the HostGroup you specify, then connect to all of them and look for any IP Conflict errors in \/var\/log\/vmkernel.log\r\n\t\r\n.NOTES\r\n Version: 1.0.1\r\n Author: Kyle McDonald\r\n Twitter: @KarmicIT\r\n Github: https:\/\/gitlab.com\/KarmicIT\/public\r\n Change Log\r\n\tv1.0, 20190617 - KJM\r\n\t+ Initial version\r\n\t\r\n.LINK\r\n https:\/\/gitlab.com\/KarmicIT\/public\/blob\/master\/Get-ESXi_IP_Conflicts.ps1\r\n\r\n.PARAMETER HostGroup\r\n Name of Host \/ Cluster \/ Datacenter to check. If you dont provide this on the CLI you will be prmopted for it.\r\n\r\n.EXAMPLE\r\n .\\Get-ESXi_IP_Conflicts.ps1 -hostgroup *\r\n .\\Get-ESXi_IP_Conflicts.ps1 -hostgroup CLUSTER_01\r\n#>\r\n\r\nParam\r\n(\r\n [Parameter(Mandatory=$false)][string]$HostGroup = $(Read-Host -prompt \"`nEnter name of Host \/ Cluster \/ Datacenter to check\")\r\n)\r\n\r\n#cls\r\n$count = 0\r\n$hosts = Get-VMhost $HostGroup | Sort-Object name\r\n$hostcount = ($hosts).count\r\nwrite-host \"`nChecking $hostcount servers\" -ForegroundColor Green\r\nforeach ($Hostname in $Hosts.name) {\r\n $count++\r\n write-progress -Activity \"Checking Hosts\" -CurrentOperation \"$Hostname\" -PercentComplete (($count \/ $Hostcount) * 100)\r\n\r\n $hostlog = (Get-Log -VMHost (Get-VMHost $Hostname) vmkernel).Entries | Where-Object {$_ -like \"*is using my IP address*\" } | Select-Object -last 1\r\n if ($null -ne $hostlog) {write-host $Hostname -ForegroundColor Yellow -nonewline; write-host \" -\" $hostlog}\r\n}\r\nwrite-host \"Done`n\" -ForegroundColor Green\r\n\r\n<\/pre>\n