{"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

<#\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

 <\/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>→<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,30,7],"tags":[],"yoast_head":"\nFinding ESXi hosts with IP conflicts - Kyle McDonald<\/title>\n<meta name=\"description\" content=\"The following PowerCLI script will help check your ESXi host for IP conflicts.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Finding ESXi hosts with IP conflicts - Kyle McDonald\" \/>\n<meta property=\"og:description\" content=\"The following PowerCLI script will help check your ESXi host for IP conflicts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/\" \/>\n<meta property=\"og:site_name\" content=\"Kyle McDonald\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-19T12:55:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-27T12:30:17+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@KarmicIT\" \/>\n<meta name=\"twitter:site\" content=\"@KarmicIT\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kylemcdonald.com.au\/#website\",\"url\":\"https:\/\/kylemcdonald.com.au\/\",\"name\":\"Kyle McDonald\",\"description\":\"Perth-based IT enthusiast\",\"publisher\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/#\/schema\/person\/f3fe27d0e0f57ef43e2444fbe8989906\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/kylemcdonald.com.au\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-AU\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/#webpage\",\"url\":\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/\",\"name\":\"Finding ESXi hosts with IP conflicts - Kyle McDonald\",\"isPartOf\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/#website\"},\"datePublished\":\"2019-06-19T12:55:01+00:00\",\"dateModified\":\"2019-07-27T12:30:17+00:00\",\"description\":\"The following PowerCLI script will help check your ESXi host for IP conflicts.\",\"inLanguage\":\"en-AU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/\"]}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/#webpage\"},\"author\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/#\/schema\/person\/f3fe27d0e0f57ef43e2444fbe8989906\"},\"headline\":\"Finding ESXi hosts with IP conflicts\",\"datePublished\":\"2019-06-19T12:55:01+00:00\",\"dateModified\":\"2019-07-27T12:30:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/#\/schema\/person\/f3fe27d0e0f57ef43e2444fbe8989906\"},\"articleSection\":\"ESXi,Scripting,VMware\",\"inLanguage\":\"en-AU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kylemcdonald.com.au\/2019\/06\/19\/finding-esxi-hosts-with-ip-conflicts\/#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/kylemcdonald.com.au\/#\/schema\/person\/f3fe27d0e0f57ef43e2444fbe8989906\",\"name\":\"Kyle McDonald\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/kylemcdonald.com.au\/#personlogo\",\"inLanguage\":\"en-AU\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/74b24af47c7a561be463563db3fa821c?s=96&d=mm&r=g\",\"caption\":\"Kyle McDonald\"},\"logo\":{\"@id\":\"https:\/\/kylemcdonald.com.au\/#personlogo\"},\"sameAs\":[\"http:\/\/au.linkedin.com\/in\/karmicit\",\"https:\/\/twitter.com\/KarmicIT\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/posts\/350"}],"collection":[{"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":6,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/posts\/350\/revisions\/371"}],"wp:attachment":[{"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kylemcdonald.com.au\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}