During the last days I had the problem on my ESXi Server that it was not reachable.
The Server itself and the VMs were running fine. So it was no crash or something like that. After I took a closer look at the problem with the support console, I noticed that my management network connection had some weird values.
Link: Up <- with the cable disconnected?
Linkspeed: 65535Mbs <- Hmm, cool in an Gigabit network
The first thing I tried was to restart my management network via the menu but this time it doesn’t helped. So I tried my luck in the support console by typing esxcfg-nics -a vmnic0.
The result was that my Server was reachable again and the values of the network connection were back to normal.
To automate this action I wrote a little Python Script which detects these abnormal values and resets them to normal by executing esxcfg-nics –a <interface>.
All I had to do is to place the script on the ESXi Server in a directory which is not deleted or overwritten if the server gets restarted and to add it as a cronjob which is executed every 30minutes.
In my case I placed the Script on the VMFS-Data storage.
The only thing which is left to do is to save the cronjobs so that they were persistent even if I reboot the Server. But I didn’t figured this out how to do it.
The Script is available here to Download: nic_check.py