ESXi Guest e1000 tweaks

Windows

Refer to this KB article @ VMWare
Poor network performance on Windows 2008 Server virtual machine

Linux

    Disable TCP Segmenation Offload
    ethtool -K eth0 tso off
    ethtool -K eth1 tso off
    Increase Descriptors
    ethtool -G eth0 rx 4096 tx 4096
    ethtool -G eth1 rx 4096 tx 4096

    You can either add these to rc.local (or your distros equivalent) or my preference is to create a package (rpm/deb) so you can push/pull these to systems easily.

    You could also create /etc/modprobe.d/e1000.conf and add the below

    alias eth0 e1000
    options e1000 RxDescriptors=4096,4096 TxDescriptors=4096,4096

    and/or in /etc/network/interfaces:

    auto eth0
    iface eth0 inet dhcp
         up ethtool -G eth0 rx 4096 tx 4096
         up ethtool -K eth0 tso off

If you are still experiencing issues, you may just need to bite the bullet and use the vmxnet3 driver which has eliminated packet-loss/drops in the large majority of cases.

check_mk local check SSL certificate expiration

Was getting sick of tracking certificates expirations in confluence and setting reminders in my calendars, so I thought, Hey, why not make the monitoring system do this?

#!/usr/bin/perl
 
use strict;
use warnings;
use Net::SSL::ExpireDate;
use DateTime;
 
my $daysleft ;
my $endDate ;
my $dtnow = DateTime->now ;
my $status = { 'txt' =>; 'OK', val => 0 };
 
my @hosts ;
 
push @hosts, 'www1.exmaple.com'
 
foreach my $host (@hosts) {
        check_ssl_certificate($host);
}
 
sub check_ssl_certificate {
        my $host = shift;
        my $ed = Net::SSL::ExpireDate->new( https => "$host:443" ) ;
        if ( defined $ed->expire_date ) {
                $endDate = $ed->expire_date ;
                if ( $endDate >= DateTime->now ) {
                        $daysleft = $dtnow->delta_days($endDate)->delta_days ;
                        if ( $daysleft < 90 ) {
                                 $status = { 'txt' => 'WARNING', 'val' => 1 } ;
                        } elsif ( $daysleft <= 45 ) {
                                 $status = { 'txt' => 'CRITICAL', 'val' => 2 } ;
                        } else {
                                $status = { 'txt' => 'OK', 'val' => 0 } ;
                        }
                } else {
                        $status = { 'txt' => 'CRITICAL', 'val' => 2 } ;
                }
                print "$status->{val} SSL_Certificate_$host Days=$daysleft; $status->{txt} - $host Expires on $endDate ($daysleft days)n";
        }
}
 
exit($?);