Check SLA uptime in a linux server

13 01 2018

When a new server is up, usually from a remote provider, their reliability is covered under a Service License Agreement. In that document is reflected the garanteed uptime of the machine, a percentage value close to 100% which assure the time that the server have to be up.

There can be other clauses with the network uptime, storage uptime, what ever other service we had uptime that will aso have to be taken into account to the global uptime of our service. But now we are only going to focus exclusively on the operating system uptime. To know what is the value from our side, these are the steps:

When you have the access to the new server, as soon as posible, install the Tuptime package:

# apt-get install tuptime

Increase the sync interval. By default it save the time on disc each 5 minutes, which is ok for a normal user, but to have it as detailed proof of service, it can be done each minute. Change in “/etc/cron.d/tuptime” from:

*/5 * * * * tuptime if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi

To:

* * * * * tuptime if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi

Or more agressive, assure the sync operation to disc too:

* * * * * tuptime if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x && sync > /dev/null; fi

Now it’s done, wait a few days or weeks and check how are things going.

Check the uptime for the last month. As one month (30 days) are 2592000 seconds, get the last n seconds from date:

# tuptime --tsince -2592000
System startups: 3 since 15:17:42 14/12/17
System shutdowns: 1 ok - 1 bad
System uptime: 97.3 % - 29 days, 4 hours, 35 minutes and 7 seconds
System downtime: 2.7 % - 19 hours, 24 minutes and 53 seconds
System life: 30 days, 0 hours, 0 minutes and 0 seconds
...

Check the uptime for the last year. As a year have 31536000 seconds:

# tuptime --tsince -31536000
System startups: 6 since 15:20:03 13/01/17
System shutdowns: 1 ok - 4 bad
System uptime: 94.39 % - 344 days, 12 hours, 33 minutes and 46 seconds
System downtime: 5.61 % - 20 days, 11 hours, 26 minutes and 14 seconds
System life: 1 year, 0 days, 0 hours, 0 minutes and 0 seconds>
...

The output give us a clear report of the uptime percentage. Even, it is possible to see the exact date and time if the “-t” table or “-l” option are passed to the command.

This is a good option to check the garanteed value without using any graph or pannel provided by the server provider. We have a strong view of how good or bad are service, any strange restart, even those that happen at intimely hours, will be registered and counted in the tuptime report.

Note:
If is required in the report an uptime / downtime percentage larger than two decimals, which is the default, use “–decp” option with the desired lenght.

More info:
https://github.com/rfrail3/tuptime/

Advertisements




Increase filesystem without lvm in VMWare

4 12 2017

This method allow to increase a filesystem without using lvm, a simple virtual disk assigned to a virtual machine. It works if it is the root partition too. It doesn’t require reboot.

Note: Only works if the filesystem partition to grow is the last partition of the disk:

0.- Make a clone of the virtual machine for backup.

1.- Resize virtual disk in VMWare.

2.- Inside the vm, check the scsi connected devices:
# ls /sys/class/scsi_device/
0:0:0:0 2:0:0:0

3.- Force a reescan:
# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
# echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan

4.- Move the GTP backup partition table to the real end of the resized disk:
# gdisk /dev/sda
Command (? for help):
x
Command (? for help):
e
Relocating backup data structures to the end of the disk
Expert command (? for help):
w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N):
Y

5.- Notify the partition change:
# partprobe

6.- Delete the target partition and recreate it using the new extra espace. This is only to define the new end of the partition:
# gdisk /dev/sda
Command (? for help):
d
Partition number (1-3):
3
Command (? for help):
n
Partition number (3-128, default 3):
[ENTER]
First sector (34-73400286, default = 2222080) or {+-}size{KMGTP}:
[ENTER]
Last sector (2222080-73400286, default = 73400286) or {+-}size{KMGTP}:
[ENTER]
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
[ENTER]
Changed type of partition to 'Linux filesystem'
Command (? for help):
w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N):
Y

7.- Notify the partition change:
# partprobe

8.- Finally, grow the filesystem:
# resize2fs /dev/sda3





Enable autologin in Debian with Systemd

19 05 2017

For allow autologin in a Debian system with systemd (very usefull with testing virtual machines):

Create dir:
mkdir /etc/systemd/system/getty@tty1.service.d/

Create file /etc/systemd/system/getty@tty1.service.d/override.conf with the following content:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM

More info:
http://forums.debian.net/viewtopic.php?f=16&t=123694





Install VMware Horizon Client in Debian 8 Jessie

24 02 2017

Download the linux client from the VMware website:

https://my.vmware.com/en/web/vmware/info/slug/desktop_end_user_computing/vmware_horizon_clients/4_0

The downloaded file is a bash script, execute it from a privileged user:

# bash VMware-Horizon-Client-4.3.0-4710754.x64.bundle

Install dependencies:

# apt-get install libudev-dev libffi-dev libglibmm-2.4-dev

Before finish the install, click into the “Scan” button. If libffi.so.5 is missing and you have libffi.so.6 only (usually in a modern Debian), create a symlink for bypass:

cd /usr/lib/x86_64-linux-gnu && ln -s libffi.so.6 libffi.so.5

Probably, if you execute now the client, it doesn’t start because the following:

$ vmware-view
/usr/lib/vmware/view/bin/vmware-view: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

Solve that creating a simlink:

# cd /lib/x86_64-linux-gnu && ln -s libudev.so.1 libudev.so.0

And run!:

$ vmware-view





Install VMWare Tools in Debian – 2016

1 09 2016

Since the supoort for the official and propietary VMWare Tools shiped from VMWare are ended in favour of the Open VM Tools, the execution of the “vmware-install.pl” script passed away.

The official document pointed to this change is the “VMware support for Open VM Tools (2073803)”, highlightning from there the following lines:

– VMware recommends using OVT redistributed by operating system vendors.
– VMware fully supports virtual machines that include OVT redistributed by operating system vendors, which is done in collaboration with the OS vendor and OS communities. However, the operating system release must be published as certified by the specific VMware product in the online VMware Compatibility Guide.
– VMware provides assistance to operating system vendors and communities with the integration of open-vm-tools with OS releases.
– VMware fully supports virtual appliances that include OVT , which is done in collaboration with the virtual appliance vendor.
– VMware does not recommend removing OVT redistributed by operating system vendors.

So, now, installing Open VM Tools is as easier as other package:

# apt-get install open-vm-tools

https://packages.debian.org/search?keywords=open-vm-tools

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2073803





Install official vmware-view-client in Debian 8 Jessie

28 04 2015

As 2017, this document is deprecated, please, follow the method indicated here: https://elhombrequereventodeinformacion.wordpress.com/2017/02/24/1969/

 

For x64 systems aren’t available the official pacakge of Vmware View Client. The only solution is make the trick with an old Ubuntu version package and the multiarch support of Debian.

First, add the x86 multiarch support:
dpkg --add-architecture i386
apt-get update

Install Gdebi for an easy dependency resolution:
apt-get install gdebi
Download libssl and vmware-view-client from Ubuntu site or from my github account:
wget 'http://archive.canonical.com/ubuntu/pool/partner/v/vmware-view-client/vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb'
wget 'http://mirrors.kernel.org/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2_i386.deb'
wget 'https://github.com/rfrail3/misc/blob/master/vmware/vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb?raw=true'
wget 'https://github.com/rfrail3/misc/blob/master/vmware/libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb?raw=true'

Install the packages and accept dependencies:
gdebi libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb
gdebi vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb

If all was ok, the new VMware View Client is available under your desktop menu.





Instalar Vmware View Client en Debian x64

13 12 2013

Si se tiene un sistema linux x64 y se pretende instalar Vmware View Client tendremos el principal problema de que no se han publicado un cliente oficial para esta arquitectura.

Como solución, teniendo Debian 7, podemos habilitar multiarch para permitir la instalación de paquetes x86 y bajar algún que otro paquete de ubuntu para finalmente solventar las dependencias.

Primero habilitamos multiarch:
dpkg --add-architecture i386
apt-get update

Instalamos Gdebi, para facilitar la resolución de dependencias:
apt-get install gdebi

Descargar vmware-view-client_2.1.0-0ubuntu0.12.04_i386.deb desde alguno de estos sitios:
http://archive.canonical.com/ubuntu/pool/partner/v/vmware-view-client/
https://github.com/rfrail3/misc/blob/master/vmware/vmware-view-client_2.1.0-0ubuntu0.12.04_i386.deb

Descargar libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb desde alguno de estos sitios:
http://packages.ubuntu.com/precise-updates/i386/libssl0.9.8/download
https://github.com/rfrail3/misc/blob/master/vmware/libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb

Instalar libssl y vmware view:
# gdebi libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb
# gdebi vmware-view-client_2.1.0-0ubuntu0.12.04_i386.deb

Si todo ha ido bien, ya tendremos disponible el acceso desde Aplicaciones > Internet > VMware View Client

Fuente:
http://blog.mbentley.net/2013/05/vmware-view-client-2-0-on-debian-wheezy-i386amd64/