Category: Linux

Leave a reply

Checking ESXi NTP

So i just happen to check the time on one of my ESXi hosts, and noticed that the time was way off, by like hours. I checked the NTP service on the host, and it was not running. So updated and stated to check the other hosts. However, I didn’t feel like logging into each one. So I found a few one liners that helped me check all the hosts in my environment, and updated where necessary.

First, connect to the appropriate vcenter
then run the following to get the time and service status on all hosts on that vCenter

Get-VMHost | Sort-Object Name |  Select Name, @{N=";NTPServer";;E={$_ |Get-VMHostNtpServer}}, Timezone, @{N=";CurrentTime";;E={(Get-View $_.ExtensionData.ConfigManager.DateTimeSystem) | Foreach {$_.QueryDateTime().ToLocalTime()}}}, @{N=";ServiceRunning";;E={(Get-VmHostService -VMHost $_ | Where-Object {$_.key -eq "ntpd";}).Running}} ` | Format-Table -AutoSize 

If you need to update your ntp server
First, remove the old NTP Server

Remove-VMHostNTPSserver -NTPServer <NTP Server> -vmhost (Get-VMHost) -confirm

Second, add the new one

Get-VMHost | Add-VMHostNtpServer -NtpServer 172.16.4.53

If you need start and stop the NTP Service and set to automatic

Get-VMHost| Get-VMHostService| Where-Object{$_.key -eq"ntpd"} | Start-VMHostServiceGet-VMHost

Get-VMHostService| Where-Object{$_.key -eq"ntpd"} | Set-VMHostService-policy "automatic"

That should get the host back on the same time

On a side note, I did this all with PowerShell Core on Ubuntu, with the VMWare Core powershell modules loaded. I noticed, that if you use Sort, rather than Sort-Object pwsh does not recognize it.


Leave a reply

That didn’t take long

Newly-ish created VPS is getting attacked

Oct 9 13:28:52 ip-xxx-xx-xx-xxx sshd[2006]: Received disconnect from 95.215.62.242: 11: Bye Bye [preauth]
Oct 9 13:28:53 ip-xxx-xx-xx-xxx sshd[2008]: reverse mapping checking getaddrinfo for niggacanttouchme [95.215.62.242] failed – POSSIBLE BREAK-IN ATTEMPT!
Oct 9 13:28:53 ip-xxx-xx-xx-xxx sshd[2008]: Received disconnect from 95.215.62.242: 11: Bye Bye [preauth]
Oct 9 13:28:54 ip-xxx-xx-xx-xxx sshd[2010]: reverse mapping checking getaddrinfo for niggacanttouchme [95.215.62.242] failed – POSSIBLE BREAK-IN ATTEMPT!
Oct 9 13:28:54 ip-xxx-xx-xx-xxx sshd[2010]: Received disconnect from 95.215.62.242: 11: Bye Bye [preauth]
Oct 9 13:33:08 ip-xxx-xx-xx-xxx sshd[2012]: Address 192.228.218.101 maps to broadband.time.net.my, but this does not map back to the address – POSSIBLE BREAK-IN ATTEMPT!


Leave a reply

IPTables

well… I don’t really work with IPTables too much… but note to self.

When adding a new rule, add it before the reject all statement.


Leave a reply

F22 –> F23

that was easy

sudo dnf install dnf-plugin-system-upgrade

sudo dnf system-upgrade download –releasever=23 –best

sudo dnf system-upgrade reboot

done 🙂


Leave a reply

Upgrading from Fedora 22 to Fedora 23

For anyone updating from Fedora 22 to Fedora 23

http://fedoramagazine.org/upgrading-from-fedora-22-to-fedora-23


%d bloggers like this:
Bitnami