2021-07-23

MONITOR ROUTE TABLE IN LINUX

MONITOR ROUTE TABLE IN LINUX

#!/bin/bash
#!/bin/sh -e
#/opt/script/routing-monitor-stats.sh
##############################################
#LastUpdate: 2021.07.23 8:28:04
##############################################
# Check ROUTING status every minute:
# * * * * * /opt/script/routing-monitor-stats.sh >> /opt/log/routing-monitor-stats/routing-monitor-stats.log 2>&1
##############################################
now1="$(date +'%Y.%m.%d-%H.%M.%S.%3N')"
##############################################
COMMAND1="ip route"
SUBNET1="192.168.202"
##############################################
mkdir -p /opt/log/routing-monitor-stats/
cd /opt/log/routing-monitor-stats/

VAR1=$($COMMAND1 | grep "$SUBNET1" | awk '{print $1}');
if [ -z "$VAR1" ]
then
      /opt/script/route-2-dbzone.sh
      echo "[$now1]: Subnet [$SUBNET1"".0/24] is MISSING";
else      
      echo "[$now1]: Subnet [$SUBNET1"".0/24] is RUNNING";
fi

#truncate file, keep 7days log:
FILE_NAME="/opt/log/routing-monitor-stats/routing-monitor-stats.log"
tail -10080 $FILE_NAME > $FILE_NAME.temp && cat $FILE_NAME.temp > $FILE_NAME
#THE_END

2021-07-18

Windows Subsystem for Linux Installation Guide for Windows 10/11

#Windows Subsystem for Linux Installation Guide for Windows 10/11:
#REF: https://docs.microsoft.com/en-us/windows/wsl/install-win10

# Manual Installation Steps
# Step 1 - Enable the Windows Subsystem for Linux
# You must first enable the "Windows Subsystem for Linux" optional feature before installing any Linux distributions on Windows.
# Open PowerShell as Administrator and run:
# PowerShell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

# Step 2 - Check requirements for running WSL 2
# To update to WSL 2, you must be running Windows 10.

# Step 3 - Enable Virtual Machine feature
# Before installing WSL 2, you must enable the Virtual Machine Platform optional feature. Your machine will require virtualization capabilities to use this feature.
# Open PowerShell as Administrator and run:
# PowerShell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
#Restart your machine to complete the WSL install and update to WSL 2.

# Step 4 - Download the Linux kernel update package
# Download the latest package:

# Step 5 - Set WSL 2 as your default version
# Open PowerShell and run this command to set WSL 2 as the default version when installing a new Linux distribution:
# PowerShell
wsl --set-default-version 2

# Step 6 - Install your Linux distribution of choice
# Open the Microsoft Store and select your favorite Linux distribution.
wsl --list --verbose

#9:36 2021.07.18
#REF: https://github.com/microsoft/WSL/issues/5393
If someone have trouble in Windows 11
you should:
wsl --update
wsl --shutdown

#https : //wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Install WSL on Windows 10 | Microsoft Docs


CONGRATULATIONS! You've successfully installed and set up a Linux distribution that is completely integrated with your Windows operating system!