This tool shows you quickly an overview of status information of all your gateways with only one CLI command. It shows the most important performance relevant information of all gateways, which are briefly summarized in this article (R80.x - Top 20 Gateway Tuning Tips ).
Just install the tool on the management SMS or MDS and execute the CLI command "eview".
# eview
# eview -r -> Shows remote access statistics (VPN User, MOB Portal User, Office Mode IP's, SNX User,...) # eview -n -> Shows interfaces with network errors: - Interfaces with more then 0.1% errors (RX-DRP, RX-OVR) and 0.0001% (RX-ERR) - Interfaces with half duplex - Interfaces with bad or unsupported driver
Installation: U se this one-liner to install this tool via internet :
Click to Expand (Highlight to read) curl_cli -k http://www.ankenbrand24.de/inst_eview > /tmp/inst_eview && chmod 770 /tmp/inst_eview && /tmp/inst_eview
curl_cli -k http://www.ankenbrand24.de/inst_eview > /tmp/inst_eview && chmod 770 /tmp/inst_eview && /tmp/inst_eview
or "copy and past" this to your SMS or MDS to install the tool:
Click to Expand (Highlight to read) cat <<EOT > /usr/bin/eview
#!/bin/bash
#
# Script Author : Heiko Ankenbrand
# Script Website : https://www.ankenbrand24.de
# Script Source : https://www.ankenbrand24.de/inst_eview
# License : GNU General Public License (GPL)
#
if [[ -e /etc/profile.d/CP.sh ]]; then source /etc/profile.d/CP.sh; else echo "Unsupported Environment"; exit 1; fi
if [[ -e /etc/profile.d/vsenv.sh ]]; then source /etc/profile.d/vsenv.sh; fi
FILE_PATH="/var/log/ebackup";
mkdir \$FILE_PATH > /dev/null 2>&1;
rm /tmp/eview_topo > /dev/null 2>&1;
rm /tmp/eview_MGTIP > /dev/null 2>&1;
# rm /usr/local/bin/ebackup > /dev/null 2>&1;
rm /tmp/eview_mdsstatus > /dev/null 2>&1;
rm /tmp/eview_login > /dev/null 2>&1;
REMOTE_RM="\$FILE_PATH/202*";
rm \$REMOTE_RM > /dev/null 2>&1;
NOW=\$(date +"%Y_%m_%d_%H%M");
clear;
echo -e "\e[7m";
printf '%.s-' {1..78};echo;
echo '- Easy View Tool v0.8 - Author Heiko Ankenbrand 2020 -';
printf '%.s-' {1..78};
echo -e "\e[0m"
SHOW_SUM="0";
MGPORT="443";
SHOWFILE="0";
REMOTEACCESS="0";
NETWORK="0";
serv_value="99";
REMOTE_INFO_V="0";
RVER=`fwm ver | awk '{print \$8}'`;
mSITIONAL=()
while [[ \$# -gt 0 ]]
do
key="\$1"
case \$key in
-h|--help|-\?)
shift;
echo;echo 'Help: ';echo;
SHOW_SUM="0";
exit 1;
;;
-v)
shift;
SHOW_SUM="0";
SHOWFILE="1";
;;
-a|-all)
shift;
SHOW_SUM="0";
REMOTEACCESS="1";
NETWORK="1";
;;
-r|-remoteaccess)
shift;
SHOW_SUM="0";
REMOTEACCESS="1";
;;
-n|-network)
shift;
SHOW_SUM="0";
NETWORK="1";
;;
*) # unknown option
#echo "unknown"
POSITIONAL+=("\$1") # save it in an array for later
shift # past argument
SHOW_SUM="1";
;;
esac
done
############ Check MDS and SMS #########
echo;
if [ "X\$MDSDIR" != "X" ]; then
MDSSTATUS_HA=\$(mdsstat | grep -m 1 MDS | awk '{print \$8}');
if [ \$MDSSTATUS_HA = "up" ]; then
mgmt_cli -r --port \$MGPORT true show version 2>&1> /tmp/eview_login;
if grep -q Gaia /tmp/eview_login; then
echo -n "The MDS is running in version "\$RVER;echo ".";echo;
serv_value="1";
else
echo "The MDS is running but a connect to management API isn't possible.";echo;
exit 1;
fi
else
echo -n "MDS is not running. (Status > "\$MDSSTATUS_HA;echo ")";echo;
exit 1;
fi
else
#Check SMS
CPM_PID=\$(ps -efww | grep java | grep cpm.Cpm | awk '{print \$2}');
if [ -z \$CPM_PID ]; then
echo "The SMS is not running.";echo;
exit 1;
else
mgmt_cli -r --port \$MGPORT true show version 2>&1> /tmp/eview_login;
if grep -q Gaia /tmp/eview_login; then
echo -n "The SMS is running in version "\$RVER;echo ".";echo;
serv_value="0";
else
echo "The SMS is running but a connect to management API isn't possible.";echo;
exit 1;
fi
fi
fi
if [ \$serv_value -eq 1 ]; then
mdsenv > /dev/null 2>&1;
mdsstat | grep CMA | awk '{print \$6}' >> /tmp/eview_MGTIP
mdsstat | grep MDS | awk '{print \$6}' >> /tmp/eview_MDSIP
fi
############ Read gateways #########
if [ \$serv_value -gt 0 ]; then
echo "Read gateways from CMA: ";echo;
while read -r hostip;
do
CMASTATUS_HA=\$(mdsstat | grep CMA| grep \$hostip | awk '{print \$8}');
CMANAME_HA=\$(mdsstat | grep CMA| grep \$hostip | awk '{print \$4}');
if [ \$CMASTATUS_HA = "up" ]; then
echo " OK - "\$CMANAME_HA;
CMACOUNT=\$(mgmt_cli -r --port \$MGPORT true -d \$hostip show gateways-and-servers offset 0 limit 500 details-level full --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2| grep -c ".");
if [ \$CMACOUNT != 0 ]; then
mgmt_cli -r --port \$MGPORT true -d \$hostip show gateways-and-servers offset 0 limit 500 details-level full --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2 | grep -v 0.0.0. | sed -e "s/\$/ \$hostip/" >> /tmp/eview_topo;
fi
else
echo " Failed - "\$CMANAME_HA;
fi
done < /tmp/eview_MGTIP
echo;
else
# read SMS gateways
mgmt_cli -r --port \$MGPORT true show gateways-and-servers details-level full limit 500 offset 0 --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2 | grep -v 0.0.0. |grep -v null | sed -e "s/\$/ x.x.x.x/" 2>&1> /tmp/eview_topo;
fi
######## GAIA Config save all gateways #########
if [ ! -f /tmp/eview_topo ]; then
echo "No gateways found!";
else
while read -r REMOTE_IP REMOTE_NAME REMOTE_CMA;
do
mdsenv \$REMOTE_CMA > /dev/null 2>&1;
echo "leer" > /tmp/eview_gateway_info.txt;
# echo \$REMOTE_IP \$REMOTE_NAME;
$CPDIR/bin/cprid_util -server \$REMOTE_IP putfile -local_file /usr/bin/eview_command -remote_file /var/log/eview_command.txt > /dev/null 2>&1;
$CPDIR/bin/cprid_util -server \$REMOTE_IP -verbose rexec -rcmd /bin/bash -f /var/log/eview_command.txt > /dev/null 2>&1;
$CPDIR/bin/cprid_util -server \$REMOTE_IP getfile -remote_file /var/log/eview_output1.txt -local_file /tmp/eview_gateway_info.txt > /dev/null 2>&1;
# cat /tmp/eview_gateway_info.txt;
echo -e "\e[7m";
# echo "\$REMOTE_NAME";
printf " %-77s" \$REMOTE_NAME;
echo -e "\e[0m"
# echo "Firewall | \$REMOTE_NAME (\$REMOTE_IP)";
printf '%.s-' {1..78};echo;
if grep -q leer /tmp/eview_gateway_info.txt; then
echo "Status | gateway down";
else
EVIEW_OS_OS=\`grep EVIEW_OS_OS /tmp/eview_gateway_info.txt | sed 's/EVIEW_OS_OS //g'\`; [ -z "\$EVIEW_OS_OS" ] && { EVIEW_OS_OS="-"; };
EVIEW_OS_KERNEL=\`grep EVIEW_OS_KERNEL /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_KERNEL" ] && { EVIEW_OS_KERNEL="-"; };
EVIEW_OS_BIT=\`grep EVIEW_OS_BIT /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_BIT" ] && { EVIEW_OS_BIT="-"; };
EVIEW_OS_JHF=\`grep EVIEW_OS_JHF /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_JHF" ] && { EVIEW_OS_JHF="-"; };
EVIEW_OS_APP=\`grep EVIEW_OS_APP /tmp/eview_gateway_info.txt | sed 's/EVIEW_OS_APP //g'\`; [ -z "\$EVIEW_OS_APP" ] && { EVIEW_OS_APP="-"; };
echo "IP | \$REMOTE_IP";
echo "OS | \$EVIEW_OS_OS (\$EVIEW_OS_BIT Bit, Kernel \$EVIEW_OS_KERNEL, JHF \$EVIEW_OS_JHF) ";
echo "Hardware | \$EVIEW_OS_APP";
if [[ \$EVIEW_OS_OS == *"Embedded"* ]]; then
echo "Status | embedded (no more infos)";
else
EVIEW_CPU_CORES=\`grep EVIEW_CPU_CORES /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_CORES //g'\`; [ -z "\$EVIEW_CPU_CORES" ] && { EVIEW_CPU_CORES="-"; };
EVIEW_CPU_SPEED=\`grep EVIEW_CPU_SPEED /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_SPEED //g'\`; [ -z "\$EVIEW_CPU_SPEED" ] && { EVIEW_CPU_SPEED="-"; };
EVIEW_CPU_AESNI=\`grep EVIEW_CPU_AESNI /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_AESNI //g'\`; [ -z "\$EVIEW_CPU_AESNI" ] && { EVIEW_CPU_AESNI="-"; };
echo -e "CPU | Cores: \$EVIEW_CPU_CORES \tSpeed: \$EVIEW_CPU_SPEED MHz \tAES-NI: \$EVIEW_CPU_AESNI";
EVIEW_FW_CON_NOW=\`grep EVIEW_FW_CON_NOW /tmp/eview_gateway_info.txt | sed 's/EVIEW_FW_CON_NOW //g'\`; [ -z "\$EVIEW_FW_CON_NOW" ] && { EVIEW_FW_CON_NOW="-"; };
EVIEW_FW_CON_MAX=\`grep EVIEW_FW_CON_MAX /tmp/eview_gateway_info.txt | sed 's/EVIEW_FW_CON_MAX //g'\`; [ -z "\$EVIEW_FW_CON_MAX" ] && { EVIEW_FW_CON_MAX="-"; };
EVIEW_POL_POL=\`grep VIEW_POL_POL /tmp/eview_gateway_info.txt | sed 's/VIEW_POL_POL //g'\`; [ -z "\$VIEW_POL_POL" ] && { VIEW_POL_POL="-"; };
EVIEW_POL_D=\`grep EVIEW_POL_D /tmp/eview_gateway_info.txt | sed 's/EVIEW_POL_D //g'\`; [ -z "\$EVIEW_POL_D" ] && { EVIEW_POL_D="-"; };
echo -e "Firewall | Policy: \$EVIEW_POL_POL \tDate: \$EVIEW_POL_D";
echo -e " | Connections: \$EVIEW_FW_CON_NOW (Max: \$EVIEW_FW_CON_MAX)";
EVIEW_BLADES_ENABLED=\`grep EVIEW_BLADES_ENABLED /tmp/eview_gateway_info.txt | sed 's/EVIEW_BLADES_ENABLED //g'\`; [ -z "\$EVIEW_BLADES_ENABLED" ] && { EVIEW_BLADES_ENABLED="-"; };
echo "Blades | \$EVIEW_BLADES_ENABLED";
echo "---------------+--------------------------------------------------------------";
EVIEW_CXL_STATUS=\`grep EVIEW_CXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_STATUS //g'\`; [ -z "\$EVIEW_CXL_STATUS" ] && { EVIEW_CXL_STATUS="-"; };
EVIEW_CXL_CORE=\`grep EVIEW_CXL_CORE /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_CORE //g'\`; [ -z "\$EVIEW_CXL_CORE" ] && { EVIEW_CXL_CORE="-"; };
EVIEW_CXL_LIC=\`grep EVIEW_CXL_LIC /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_LIC //g'\`; [ -z "\$EVIEW_CXL_LIC" ] && { EVIEW_CXL_LIC="-"; };
EVIEW_CXL_LOAD=\`grep EVIEW_CXL_LOAD /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_LOAD //g'\`; [ -z "\$EVIEW_CXL_LOAD%" ] && { EVIEW_CXL_LOAD="-"; };
echo -e "CoreXL | Status: \$EVIEW_CXL_STATUS \tCores: \$EVIEW_CXL_CORE \tLicense: \$EVIEW_CXL_LIC \tAVG Load: \$EVIEW_CXL_LOAD";
EVIEW_SXL_STATUS=\`grep EVIEW_SXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_STATUS //g'\`; [ -z "\$EVIEW_SXL_STATUS" ] && { EVIEW_SXL_STATUS="-"; };
EVIEW_SXL_F2F=\`grep EVIEW_SXL_F2F /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_F2F //g'\`; [ -z "\$EVIEW_SXL_F2F" ] && { EVIEW_SXL_F2F="-"; };
EVIEW_SXL_MEDIUM=\`grep EVIEW_SXL_MEDIUM /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_MEDIUM //g'\`; [ -z "\$EVIEW_SXL_MEDIUM" ] && { EVIEW_SXL_MEDIUM="-"; };
EVIEW_SXL_FAST=\`grep EVIEW_SXL_FAST /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_FAST //g'\`; [ -z "\$EVIEW_SXL_FAST" ] && { EVIEW_SXL_FAST="-"; };
EVIEW_SXL_P_F2F=\`grep EVIEW_SXL_P_F2F /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_F2F //g'\`; [ -z "\$EVIEW_SXL_P_F2F" ] && { EVIEW_SXL_P_F2F="-"; };
EVIEW_SXL_P_MEDIUM=\`grep EVIEW_SXL_P_MEDIUM /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_MEDIUM //g'\`; [ -z "\$EVIEW_SXL_P_MEDIUM" ] && { EVIEW_SXL_P_MEDIUM="-"; };
EVIEW_SXL_P_FAST=\`grep EVIEW_SXL_P_FAST /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_FAST //g'\`; [ -z "\$EVIEW_SXL_P_FAST" ] && { EVIEW_SXL_P_FAST="-"; };
EVIEW_SXL_SND=\`grep EVIEW_SXL_SND /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_SND //g'\`; [ -z "\$EVIEW_SXL_SND" ] && { EVIEW_SXL_SND="-"; };
EVIEW_SXLHACPU_LOAD=\`grep EVIEW_SXLHACPU_LOAD /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXLHACPU_LOAD //g'\`; [ -z "\$EVIEW_SXLHACPU_LOAD" ] && { EVIEW_SXLHACPU_LOAD="-"; };
echo -e "SecureXL | Status: \$EVIEW_SXL_STATUS \tSND's: \$EVIEW_SXL_SND \t\t\tAVG Load: \$EVIEW_SXLHACPU_LOAD";
echo -e " | F2F: \$EVIEW_SXL_F2F \$EVIEW_SXL_P_F2F PXL: \$EVIEW_SXL_MEDIUM \$EVIEW_SXL_P_MEDIUM Accel: \$EVIEW_SXL_FAST \$EVIEW_SXL_P_FAST";
EVIEW_SXL_ACCEPT_T=\`grep EVIEW_SXL_ACCEPT_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_ACCEPT_T //g'\`; [ -z "\$EVIEW_SXL_ACCEPT_T" ] && { EVIEW_SXL_ACCEPT_T="-"; };
EVIEW_SXL_DROP_T=\`grep EVIEW_SXL_DROP_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_DROP_T //g'\`; [ -z "\$EVIEW_SXL_DROP_T" ] && { EVIEW_SXL_DROP_T="-"; };
EVIEW_SXL_NAT_T=\`grep EVIEW_SXL_NAT_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_NAT_T //g'\`; [ -z "\$EVIEW_SXL_NAT_T" ] && { EVIEW_SXL_NAT_T="-"; };
echo -e "SXL Templates | Accept: \$EVIEW_SXL_ACCEPT_T";
echo -e " | Drop : \$EVIEW_SXL_DROP_T \tNAT: \$EVIEW_SXL_NAT_T";
EVIEW_MQ_STATUS=\`grep EVIEW_MQ_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_MQ_STATUS //g'\`; [ -z "\$EVIEW_MQ_STATUS" ] && { EVIEW_MQ_STATUS="-"; };
EVIEW_NET_10000_S=\`grep EVIEW_NET_10000_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_10000_S //g'\`; [ -z "\$EVIEW_NET_10000_S" ] && { EVIEW_NET_10000_S="no"; };
echo -e "Multi Queueing | Status: \$EVIEW_MQ_STATUS \t\t10GB Interface: \$EVIEW_NET_10000_S";
EVIEW_HT_S=\`grep EVIEW_HT_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_HT_S //g'\`; [ -z "\$EVIEW_HT_S" ] && { EVIEW_HT_S="-"; };
echo "Hyper Thread. | Status: \$EVIEW_HT_S";
EVIEW_DD_S=\`grep EVIEW_DD_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_DD_S //g'\`; [ -z "\$EVIEW_DD_S" ] && { EVIEW_DD_S="-"; };
echo "Dyn Dispatcher | Status: \$EVIEW_DD_S";
EVIEW_PQ_S=\`grep EVIEW_PQ_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_PQ_S //g'\`; [ -z "\$EVIEW_PQ_S" ] && { EVIEW_PQ_S="-"; };
echo "Priority Queue | Status: \$EVIEW_PQ_S";
EVIEW_USERMODE=\`grep EVIEW_USERMODE /tmp/eview_gateway_info.txt | sed 's/EVIEW_USERMODE //g'\`; [ -z "\$EVIEW_USERMODE" ] && { EVIEW_USERMODE="-"; };
echo "Firewall Mode | Status: \$EVIEW_USERMODE";
echo "---------------+--------------------------------------------------------------";
EVIEW_CLXL_STATUS=\`grep EVIEW_CLXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_STATUS //g'\`; [ -z "\$EVIEW_CLXL_STATUS" ] && { EVIEW_CLXL_STATUS="-"; };
EVIEW_CLXL_HA=\`grep EVIEW_CLXL_HA /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_HA //g'\`; [ -z "\$EVIEW_CLXL_HA" ] && { EVIEW_CLXL_HA="-"; };
EVIEW_CLXL_ID=\`grep EVIEW_CLXL_ID /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_ID //g'\`; [ -z "\$EVIEW_CLXL_ID" ] && { EVIEW_CLXL_ID="-"; };
EVIEW_CLXL_CCP=\`grep EVIEW_CLXL_CCP /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_CCP //g'\`; [ -z "\$EVIEW_CLXL_CCP" ] && { EVIEW_CLXL_CCP="-"; };
echo -e "ClusterXL | Status: \$EVIEW_CLXL_HA \tMode: \$EVIEW_CLXL_STATUS ";
echo -e " | Cluster ID: \$EVIEW_CLXL_ID \t\tCCP: \$EVIEW_CLXL_CCP ";
echo "---------------+--------------------------------------------------------------";
EVIEW_MEMT=\`grep EVIEW_MEMT /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMT //g'\`; [ -z "\$EVIEW_MEMT" ] && { EVIEW_MEMT="-"; };
EVIEW_MEMU=\`grep EVIEW_MEMU /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMU //g'\`; [ -z "\$EVIEW_MEMU" ] && { EVIEW_MEMU="-"; };
EVIEW_MEMF=\`grep EVIEW_MEMF /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMF //g'\`; [ -z "\$EVIEW_MEMF" ] && { EVIEW_MEMF="-"; };
echo -e "Memory | Total: \$EVIEW_MEMT MB \tUsed: \$EVIEW_MEMU MB \tFree: \$EVIEW_MEMF MB ";
EVIEW_SWAPT=\`grep EVIEW_SWAPT /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPT //g'\`; [ -z "\$EVIEW_SWAPT" ] && { EVIEW_SWAPT="-"; };
EVIEW_SWAPU=\`grep EVIEW_SWAPU /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPU //g'\`; [ -z "\$EVIEW_SWAPU" ] && { EVIEW_SWAPU="-"; };
EVIEW_SWAPF=\`grep EVIEW_SWAPF /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPF //g'\`; [ -z "\$EVIEW_SWAPF" ] && { EVIEW_SWAPF="-"; };
echo -e "Swap | Total: \$EVIEW_SWAPT MB \tUsed: \$EVIEW_SWAPU MB \tFree: \$EVIEW_SWAPF MB ";
EVIEW_HD_ROOT_SIZE=\`grep EVIEW_HD_ROOT_SIZE /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_SIZE //g'\`; [ -z "\$EVIEW_HD_ROOT_SIZE" ] && { EVIEW_HD_ROOT_SIZE="-"; };
EVIEW_HD_ROOT_USED=\`grep EVIEW_HD_ROOT_USED /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_USED //g'\`; [ -z "\$EVIEW_HD_ROOT_USED" ] && { EVIEW_HD_ROOT_USED="-"; };
EVIEW_HD_ROOT_AVAIL=\`grep EVIEW_HD_ROOT_AVAIL /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_AVAIL //g'\`; [ -z "\$EVIEW_HD_ROOT_AVAIL" ] && { EVIEW_HD_ROOT_AVAIL="-"; };
echo -e "HD / | Total: \$EVIEW_HD_ROOT_SIZE \t\tUsed: \$EVIEW_HD_ROOT_USED \tFree: \$EVIEW_HD_ROOT_AVAIL ";
EVIEW_HD_LOG_SIZE=\`grep EVIEW_HD_LOG_SIZE /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_SIZE //g'\`; [ -z "\$EVIEW_HD_LOG_SIZE" ] && { EVIEW_HD_LOG_SIZE="-"; };
EVIEW_HD_LOG_USED=\`grep EVIEW_HD_LOG_USED /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_USED //g'\`; [ -z "\$EVIEW_HD_LOG_USED" ] && { EVIEW_HD_LOG_USED="-"; };
EVIEW_HD_LOG_AVAIL=\`grep EVIEW_HD_LOG_AVAIL /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_AVAIL //g'\`; [ -z "\$EVIEW_HD_LOG_AVAIL" ] && { EVIEW_HD_LOG_AVAIL="-"; };
echo -e " /var/log | Total: \$EVIEW_HD_LOG_SIZE \t\tUsed: \$EVIEW_HD_LOG_USED \tFree: \$EVIEW_HD_LOG_AVAIL ";
if [[ \$NETWORK == "1" ]] ; then
echo "---------------+--------------------------------------------------------------";
EVIEW_NET_RXERR=\`grep EVIEW_NET_RXERR /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXERR //g'\`; [ -z "\$EVIEW_NET_RXERR" ] && { EVIEW_NET_RXERR="no"; };
EVIEW_NET_RXDRP=\`grep EVIEW_NET_RXDRP /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXDRP //g'\`; [ -z "\$EVIEW_NET_RXDRP" ] && { EVIEW_NET_RXDRP="no"; };
EVIEW_NET_RXOVR=\`grep EVIEW_NET_RXOVR /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXOVR //g'\`; [ -z "\$EVIEW_NET_RXOVR" ] && { EVIEW_NET_RXOVR="no"; };
EVIEW_NET_HALF=\`grep EVIEW_NET_HALF /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_HALF //g'\`; [ -z "\$EVIEW_NET_HALF" ] && { EVIEW_NET_HALF="no"; };
EVIEW_NET_UNSUP_DRIVER=\`grep EVIEW_NET_UNSUP_DRIVER /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_UNSUP_DRIVER //g'\`; [ -z "\$EVIEW_NET_UNSUP_DRIVER" ] && { EVIEW_NET_UNSUP_DRIVER="no"; };
echo -e "Network Errors | RX-ERR (>0.0%): \$EVIEW_NET_RXERR";
echo -e " | RX-DRP (>0.1%): \$EVIEW_NET_RXDRP";
echo -e " | RX-OVR (>0.1%): \$EVIEW_NET_RXOVR";
echo -e " | Half Duplex : \$EVIEW_NET_HALF";
echo -e " | Bad Driver : \$EVIEW_NET_UNSUP_DRIVER";
fi
if [[ \$REMOTEACCESS == "1" ]] ; then
echo "---------------+--------------------------------------------------------------";
EVIEW_RA_OMIP_NORM=\`grep EVIEW_RA_OMIP_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_OMIP_NORM //g'\`; [ -z "\$EVIEW_RA_OMIP_NORM" ] && { EVIEW_RA_OMIP_NORM="-"; };
EVIEW_RA_OMIP_PEAK=\`grep EVIEW_RA_OMIP_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_OMIP_PEAK //g'\`; [ -z "\$EVIEW_RA_OMIP_PEAK" ] && { EVIEW_RA_OMIP_PEAK="-"; };
EVIEW_RA_EPUSER_NORM=\`grep EVIEW_RA_EPUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_EPUSER_NORM //g'\`; [ -z "\$EVIEW_RA_EPUSER_NORM" ] && { EVIEW_RA_EPUSER_NORM="-"; };
EVIEW_RA_EPUSER_PEAK=\`grep EVIEW_RA_EPUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_EPUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_EPUSER_PEAK" ] && { EVIEW_RA_EPUSER_PEAK="-"; };
EVIEW_RA_CWUSER_NORM=\`grep EVIEW_RA_CWUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_CWUSER_NORM //g'\`; [ -z "\$EVIEW_RA_CWUSER_NORM" ] && { EVIEW_RA_CWUSER_NORM="-"; };
EVIEW_RA_CWUSER_PEAK=\`grep EVIEW_RA_CWUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_CWUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_CWUSER_PEAK" ] && { EVIEW_RA_CWUSER_PEAK="-"; };
EVIEW_RA_MABUSER_NORM=\`grep EVIEW_RA_MABUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_MABUSER_NORM //g'\`; [ -z "\$EVIEW_RA_MABUSER_NORM" ] && { EVIEW_RA_MABUSER_NORM="-"; };
EVIEW_RA_MABUSER_PEAK=\`grep EVIEW_RA_MABUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_MABUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_MABUSER_PEAK" ] && { EVIEW_RA_MABUSER_PEAK="-"; };
EVIEW_RA_L2TPUSER_NORM=\`grep EVIEW_RA_L2TPUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_L2TPUSER_NORM //g'\`; [ -z "\$EVIEW_RA_L2TPUSER_NORM" ] && { EVIEW_RA_L2TPUSER_NORM="-"; };
EVIEW_RA_L2TPUSER_PEAK=\`grep EVIEW_RA_L2TPUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_L2TPUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_L2TPUSER_PEAK" ] && { EVIEW_RA_L2TPUSER_PEAK="-"; };
EVIEW_RA_SNXUSER_NORM=\`grep EVIEW_RA_SNXUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_SNXUSER_NORM //g'\`; [ -z "\$EVIEW_RA_SNXUSER_NORM" ] && { EVIEW_RA_SNXUSER_NORM="-"; };
EVIEW_RA_SNXUSER_PEAK=\`grep EVIEW_RA_SNXUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_SNXUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_SNXUSER_PEAK" ] && { EVIEW_RA_SNXUSER_PEAK="-"; };
echo -e "Remote Access | Office Mode IP: \$EVIEW_RA_OMIP_NORM (Peak: \$EVIEW_RA_OMIP_PEAK) \tEndpoint VPN User: \$EVIEW_RA_EPUSER_NORM (Peak: \$EVIEW_RA_EPUSER_PEAK)";
echo -e " | CapsuleW. User: \$EVIEW_RA_CWUSER_NORM (Peak: \$EVIEW_RA_CWUSER_PEAK) \tMAB Portal User : \$EVIEW_RA_MABUSER_NORM (Peak: \$EVIEW_RA_MABUSER_PEAK)";
echo -e " | L2TP User : \$EVIEW_RA_L2TPUSER_NORM (Peak: \$EVIEW_RA_L2TPUSER_PEAK) \tSNX User : \$EVIEW_RA_SNXUSER_NORM (Peak: \$EVIEW_RA_SNXUSER_PEAK)";
fi
fi
if [[ \$SHOWFILE == "1" ]]; then
printf '%.s-' {1..78};echo;
cat /tmp/eview_gateway_info.txt;
fi
rm /tmp/eview_gateway_info.txt;
fi
echo; echo;
done < /tmp/eview_topo;
fi
echo;echo;
REMOTE_RM="\$FILE_PATH/202*";
rm \$REMOTE_RM > /dev/null 2>&1;
rm /tmp/g_command.txt > /dev/null 2>&1;
rm /tmp/eview_topo > /dev/null 2>&1;
rm /tmp/eview_MGTIP > /dev/null 2>&1;
rm /tmp/eview_migrate > /dev/null 2>&1;
rm /tmp/eview_mdsstatus > /dev/null 2>&1;
rm /tmp/eview_login > /dev/null 2>&1;
rm /tmp/inst_eview > /dev/null 2>&1;
EOT
cat <<EHA > /usr/bin/eview_command
#!/bin/bash
FWVER=\`cat /etc/cp-release | cut -c 18- | sed 's/^ *//g' | sed 's/\s*\$//g'\`;
# echo \$FWVER;
J=\`cpinfo -y all 2>/dev/null | grep JUMBO | tail -n1 | awk '{print \$3}'\`;
O=\`cat /etc/cp-release | cut -c 13- | sed 's/^ *//g' | sed 's/\s*$//g'\`;
OSM=\`uname -a | grep -c x86_64\`; [ \$OSM == 0 ] && { OSM=32; } || { OSM=64; };
K=\`uname -r | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/'\`;
T=\`cpstat os | grep "Appliance Name" | tr -s ' ' | cut -c 17- \`;
CPU_S=\`cat /proc/cpuinfo |grep processor | wc -l\`;
CPU_SP=\`cat /proc/cpuinfo | grep "cpu MHz" | head -1 | awk '{printf "%3.0f\n", \$4}'\`;
CPU_AESNI=\`grep -c aes /proc/cpuinfo\`; [ \$CPU_AESNI == 0 ] && { CPU_AESNI="off"; } || { CPU_AESNI="on"; };
USERMODE=\`cpprod_util FwIsUsermode\`; [ \$USERMODE == 0 ] && { USERMODE="Kernel Mode"; } || { USERMODE="User Mode"; };
CXL_S=\`fw ctl multik stat | wc -l\`; [ \$CXL_S == 0 ] && { CXL_S="off"; } || { CXL_S="on"; };
CXL_LIC=\`fw ctl affinity -corelicnum\`;
SXL_ACCEPT_T=\`fwaccel stat |grep "Accept Templates" | cut -d ':' -f2 | sed s/'\ '//;\`;
SXL_ACCEPT_RULE=\`fwaccel stat |grep "from rule #" | cut -d '#' -f2;\`;
SXL_DROP_T=\`fwaccel stat |grep "Drop Templates" | cut -d ':' -f2 | sed s/'\ '//;\`;
SXL_NAT_T=\`fwaccel stat |grep "NAT Templates" | cut -d ':' -f2 | sed s/'\ '//| awk '{print \$1}';\`;
if [[ \$SXL_ACCEPT_T == *"disabled by Firewall"* ]]; then
SXL_ACCEPT_T=\`echo "disabled (rule: \$SXL_ACCEPT_RULE)";\`;
fi
SXL_FP=\`fwaccel stats | grep "accel packets" | awk {'print \$3'}\`;
SXL_F2F=\`fwaccel stats | grep "F2F packets" | awk {'print \$3'}\`;
SXL_SND=\`fwaccel stat | grep SND | wc -l\`; [ \$SXL_SND == 0 ] && { SXL_SND="1"; }; # R80.10 fix
SXL_F2F_P=\`fwaccel stats -s | grep F2F |awk '{print \$6}'\`;
SXL_MP_P=\`fwaccel stats -s | grep "PXL pk\|PSLXL" |awk '{print \$6}'\`;
SXL_FP_P=\`fwaccel stats -s | grep "Accelerated pkt" |awk '{print \$6}'\`;
# SecureXL hack
if [[ \$FWVER == "R80.10" ]]; then
SXL_MP=\`fwaccel stats | grep "PXL packets" | awk {'print \$3'}\`;
SXL_S=\`fwaccel stat |grep "Accelerator Status" | awk {'print \$4'}\`; echo \$SXL_S;
# echo "R80.10:-)";
else
SXL_S=\`fwaccel stat | sed -n 4p | tr '|' ' ' | awk '{print \$3}'\`;[ \$SXL_S == "enabled" ] && { SXL_S="on"; } || { SXL_S="off"; };
SXL_MP=\`fwaccel stats | grep "PSLXL packets" | awk {'print \$6'}\`;
fi
typeset -i CXL_C; if [[ \$CXL_S == "on" ]]; then CXL_C=\`fw ctl multik stat | wc -l\`;CXL_C=\$CXL_C-2; else CXL_C=0; fi ;
# echo \$CXL_C;
BL=\`enabled_blades\`;
MQ_S=\`cpmq get -a | grep On | wc -l\`; [ \$MQ_S == "0" ] && { MQ_S="off"; } || { MQ_S="on"; }; echo \$MQ_S;
CLXL_S=\`cpstat -f all ha | grep "Working mode:" | sed 's/Working mode: //g' | sed 's/(Active Up)//g'\`;
CLXL_HA=\`cphaprob stat |grep local |awk {'print \$5'}\`;
CLXL_ID=\`cphaprob mmagic | grep "MAC magic:" |awk {'print \$3'}\`;
CLXL_CCP=\`cphaprob -a if | grep -c broadcast\`; [ \$CLXL_CCP == 0 ] && { CLXL_CCP=multicast; } || { CLXL_CCP=broadcast; };
DD_S=\`fw ctl multik dynamic_dispatching get_mode | sed 's/Current mode is //g'\`; [ \$DD_S == "On" ] && { DD_S="on"; } || { DD_S="off"; };
MEMT=\`free -m | grep Mem: | awk '{print \$2}'\`;
MEMU=\`free -m | grep Mem: | awk '{print \$3}'\`;
MEMF=\`free -m | grep Mem: | awk '{print \$4}'\`;
SWAPT=\`free -m | grep Swap: | awk '{print \$2}'\`;
SWAPU=\`free -m | grep Swap: | awk '{print \$3}'\`;
SWAPF=\`free -m | grep Swap: | awk '{print \$4}'\`;
HT_S=\`cat /proc/smt_status\`; [ \$HT_S == "Unsupported" ] && { HT_S="off (BIOS)"; };
HD_ROOT_SIZE=\`df -h / |grep % |grep -v Size |awk '{print \$1}'\`;
HD_ROOT_USED=\`df -h / |grep % |grep -v Size |awk '{print \$2}'\`;
HD_ROOT_AVAIL=\`df -h / |grep % |grep -v Size |awk '{print \$3}'\`;
HD_LOG_SIZE=\`df -h /var/log |grep % |grep -v Size |awk '{print \$1}'\`;
HD_LOG_USED=\`df -h /var/log |grep % |grep -v Size |awk '{print \$2}'\`;
HD_LOG_AVAIL=\`df -h /var/log |grep % |grep -v Size |awk '{print \$3}'\`;
# Load hack
if [[ \$USERMODE == "Kernel Mode" ]]; then
CXL_LOAD=\`top -b -n 1 |grep fw_worker | awk '{sum+=\$9}END{print sum}'\`;
else
CXL_LOAD=\`top -b -n 1 |grep fwk0_dev | awk '{print \$9}'\`;
fi
if [[ \$CXL_LOAD == "0" ]]; then
CXL_LOAD="1";
fi
#Load hack SXL
SXLHACPU=\`fw ctl affinity -l -a -v |grep Interface | awk '{print \$6}' | sort |uniq | awk '{LINEHA = LINEHA "|CPU"\$1} END {print LINEHA }' | sed s/\|//; \`;
SXLHACPU_C=\`sar -P ALL 1 1 | grep Average: |grep -v CPU |grep -v all | awk '{ print "CPU"\$2 " " 100-\$8}' |egrep \$SXLHACPU |wc -l;\`;
SXLHACPU_S=\`sar -P ALL 1 1 | grep Average: |grep -v CPU |grep -v all | awk '{ print "CPU"\$2 " " 100-\$8}' |egrep \$SXLHACPU | awk '{sum+=\$2} END {print sum}';\`;
SXLHACPU_LOAD=\`echo "scale=0; \$SXLHACPU_S/\$SXLHACPU_C" |bc ;\`;
# Network Errors
NET_RXERR=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$5+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.00001 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_RXDRP=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$6+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.1 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_RXOVR=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$7+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.1 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_HALF=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Duplex|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "Half") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_10M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_100M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "100Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_1000M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "1000Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_10000_S=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10000Mb/s") { L="yes"}; } END {print L}' | sed s/://g;\`;
NET_10000M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10000Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_UNSUP_DRIVER=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1) system("ethtool -i " \$1) }' | egrep "Settings|driver|Link" | xargs -n 8 | grep yes| egrep "tg3|bge|bnx2|be2net" |awk '{ L=L \$3" ("\$8"), " } END {print L}' |sed s/://g| sed s/..\$//\`;
CXL_LOAD_INT=\`echo "scale=0; \$CXL_LOAD/\$CXL_C" |bc -l\`;
FW_CON_NOW=\`fw tab -t connections -s | grep localhost |awk '{print \$4}'\`;
FW_CON_MAX=\`fw tab -t connections -s | grep localhost |awk '{print \$5}'\`;
RA_OMIP_NORM=\`fw tab -t om_assigned_ips -s | grep localhost | awk '{print \$4}'\`;
RA_OMIP_PEAK=\`fw tab -t om_assigned_ips -s | grep localhost | awk '{print \$5}'\`;
RA_EPUSER_NORM=\`fw tab -t userc_users -s | grep localhost | awk '{print \$4}'\`;
RA_EPUSER_PEAK=\`fw tab -t userc_users -s | grep localhost | awk '{print \$5}'\`;
RA_CWUSER_NORM=\`fw tab -t mob_mail_session -s | grep localhost | awk '{print \$4}'\`;
RA_CWUSER_PEAK=\`fw tab -t mob_mail_session -s | grep localhost | awk '{print \$5}'\`;
RA_MABUSER_NORM=\`fw tab -t cvpn_session -s | grep localhost | awk '{print \$4}'\`;
RA_MABUSER_PEAK=\`fw tab -t cvpn_session -s | grep localhost | awk '{print \$5}'\`;
RA_L2TPUSER_NORM=\`fw tab -t L2TP_tunnels -s | grep localhost | awk '{print \$4}'\`;
RA_L2TPUSER_PEAK=\`fw tab -t L2TP_tunnels -s | grep localhost | awk '{print \$5}'\`;
RA_SNXUSER_NORM=\`fw tab -t sslt_om_ip_params -s | grep localhost | awk '{print \$4}'\`;
RA_SNXUSER_PEAK=\`fw tab -t sslt_om_ip_params -s | grep localhost | awk '{print \$5}'\`;
PQ_S=\`echo "3" | fw ctl multik prioq | grep "Current" |awk '{print tolower(\$4)}'\`;
POL_POL=\`fw stat |grep localhost | awk '{print \$2}'\`;
POL_D=\`fw stat |grep localhost | awk '{print \$3 " " \$4}'\`;
echo "EVIEW_OS_OS \${O}" > /var/log/eview_output1.txt;
echo "EVIEW_OS_KERNEL \${K}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_BIT \${OSM}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_JHF \${J}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_APP \${T}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_CORES \${CPU_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_SPEED \${CPU_SP}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_AESNI \${CPU_AESNI}" >> /var/log/eview_output1.txt;
echo "EVIEW_BLADES_ENABLED \${BL}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_STATUS \${CXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_CORE \${CXL_C}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_LIC \${CXL_LIC}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_LOAD \${CXL_LOAD_INT}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_STATUS \${SXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_F2F \${SXL_F2F}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_MEDIUM \${SXL_MP}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_FAST \${SXL_FP}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_F2F \${SXL_F2F_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_ACCEPT_T \${SXL_ACCEPT_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_DROP_T \${SXL_DROP_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_NAT_T \${SXL_NAT_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_MEDIUM \${SXL_MP_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_FAST \${SXL_FP_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_SND \${SXL_SND}" >> /var/log/eview_output1.txt;
echo "EVIEW_MQ_STATUS \${MQ_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_STATUS \${CLXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_HA \${CLXL_HA}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_ID \${CLXL_ID}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_CCP \${CLXL_CCP}" >> /var/log/eview_output1.txt;
echo "EVIEW_DD_S \${DD_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMT \${MEMT}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMU \${MEMU}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMF \${MEMF}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPT \${SWAPT}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPU \${SWAPU}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPF \${SWAPF}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_SIZE \${HD_ROOT_SIZE}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_USED \${HD_ROOT_USED}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_AVAIL \${HD_ROOT_AVAIL}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_SIZE \${HD_LOG_SIZE}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_USED \${HD_LOG_USED}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_AVAIL \${HD_LOG_AVAIL}" >> /var/log/eview_output1.txt;
echo "EVIEW_HT_S \${HT_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_USERMODE \${USERMODE}" >> /var/log/eview_output1.txt;
echo "EVIEW_FW_CON_NOW \${FW_CON_NOW}" >> /var/log/eview_output1.txt;
echo "EVIEW_FW_CON_MAX \${FW_CON_MAX}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_OMIP_NORM \${RA_OMIP_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_OMIP_PEAK \${RA_OMIP_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_EPUSER_NORM \${RA_EPUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_EPUSER_PEAK \${RA_EPUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_CWUSER_NORM \${RA_CWUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_CWUSER_PEAK \${RA_CWUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_MABUSER_NORM \${RA_MABUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_MABUSER_PEAK \${RA_MABUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_L2TPUSER_NORM \${RA_L2TPUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_L2TPUSER_PEAK \${RA_L2TPUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_SNXUSER_NORM \${RA_SNXUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_SNXUSER_PEAK \${RA_SNXUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_PQ_S \${PQ_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_POL_POL \${POL_POL}" >> /var/log/eview_output1.txt;
echo "EVIEW_POL_D \${POL_D}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXLHACPU_LOAD \$SXLHACPU_LOAD" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXERR \$NET_RXERR" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXDRP \$NET_RXDRP" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXOVR \$NET_RXOVR" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_HALF \$NET_HALF" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10M \$NET_10M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_100M \$NET_100M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_1000M \$NET_1000M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10000M \$NET_10000M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10000_S \$NET_10000_S" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_UNSUP_DRIVER \$NET_UNSUP_DRIVER" >> /var/log/eview_output1.txt;
echo "END" >> /var/log/eview_output1.txt;
EHA
chmod 770 /usr/bin/eview;
chmod 770 /usr/bin/eview_command;
cat <<EOT > /usr/bin/eview
#!/bin/bash
#
# Script Author : Heiko Ankenbrand
# Script Website : https://www.ankenbrand24.de
# Script Source : https://www.ankenbrand24.de/inst_eview
# License : GNU General Public License (GPL)
#
if [[ -e /etc/profile.d/CP.sh ]]; then source /etc/profile.d/CP.sh; else echo "Unsupported Environment"; exit 1; fi
if [[ -e /etc/profile.d/vsenv.sh ]]; then source /etc/profile.d/vsenv.sh; fi
FILE_PATH="/var/log/ebackup";
mkdir \$FILE_PATH > /dev/null 2>&1;
rm /tmp/eview_topo > /dev/null 2>&1;
rm /tmp/eview_MGTIP > /dev/null 2>&1;
# rm /usr/local/bin/ebackup > /dev/null 2>&1;
rm /tmp/eview_mdsstatus > /dev/null 2>&1;
rm /tmp/eview_login > /dev/null 2>&1;
REMOTE_RM="\$FILE_PATH/202*";
rm \$REMOTE_RM > /dev/null 2>&1;
NOW=\$(date +"%Y_%m_%d_%H%M");
clear;
echo -e "\e[7m";
printf '%.s-' {1..78};echo;
echo '- Easy View Tool v0.8 - Author Heiko Ankenbrand 2020 -';
printf '%.s-' {1..78};
echo -e "\e[0m"
SHOW_SUM="0";
MGPORT="443";
SHOWFILE="0";
REMOTEACCESS="0";
NETWORK="0";
serv_value="99";
REMOTE_INFO_V="0";
RVER=`fwm ver | awk '{print \$8}'`;
mSITIONAL=()
while [[ \$# -gt 0 ]]
do
key="\$1"
case \$key in
-h|--help|-\?)
shift;
echo;echo 'Help: ';echo;
SHOW_SUM="0";
exit 1;
;;
-v)
shift;
SHOW_SUM="0";
SHOWFILE="1";
;;
-a|-all)
shift;
SHOW_SUM="0";
REMOTEACCESS="1";
NETWORK="1";
;;
-r|-remoteaccess)
shift;
SHOW_SUM="0";
REMOTEACCESS="1";
;;
-n|-network)
shift;
SHOW_SUM="0";
NETWORK="1";
;;
*) # unknown option
#echo "unknown"
POSITIONAL+=("\$1") # save it in an array for later
shift # past argument
SHOW_SUM="1";
;;
esac
done
############ Check MDS and SMS #########
echo;
if [ "X\$MDSDIR" != "X" ]; then
MDSSTATUS_HA=\$(mdsstat | grep -m 1 MDS | awk '{print \$8}');
if [ \$MDSSTATUS_HA = "up" ]; then
mgmt_cli -r --port \$MGPORT true show version 2>&1> /tmp/eview_login;
if grep -q Gaia /tmp/eview_login; then
echo -n "The MDS is running in version "\$RVER;echo ".";echo;
serv_value="1";
else
echo "The MDS is running but a connect to management API isn't possible.";echo;
exit 1;
fi
else
echo -n "MDS is not running. (Status > "\$MDSSTATUS_HA;echo ")";echo;
exit 1;
fi
else
#Check SMS
CPM_PID=\$(ps -efww | grep java | grep cpm.Cpm | awk '{print \$2}');
if [ -z \$CPM_PID ]; then
echo "The SMS is not running.";echo;
exit 1;
else
mgmt_cli -r --port \$MGPORT true show version 2>&1> /tmp/eview_login;
if grep -q Gaia /tmp/eview_login; then
echo -n "The SMS is running in version "\$RVER;echo ".";echo;
serv_value="0";
else
echo "The SMS is running but a connect to management API isn't possible.";echo;
exit 1;
fi
fi
fi
if [ \$serv_value -eq 1 ]; then
mdsenv > /dev/null 2>&1;
mdsstat | grep CMA | awk '{print \$6}' >> /tmp/eview_MGTIP
mdsstat | grep MDS | awk '{print \$6}' >> /tmp/eview_MDSIP
fi
############ Read gateways #########
if [ \$serv_value -gt 0 ]; then
echo "Read gateways from CMA: ";echo;
while read -r hostip;
do
CMASTATUS_HA=\$(mdsstat | grep CMA| grep \$hostip | awk '{print \$8}');
CMANAME_HA=\$(mdsstat | grep CMA| grep \$hostip | awk '{print \$4}');
if [ \$CMASTATUS_HA = "up" ]; then
echo " OK - "\$CMANAME_HA;
CMACOUNT=\$(mgmt_cli -r --port \$MGPORT true -d \$hostip show gateways-and-servers offset 0 limit 500 details-level full --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2| grep -c ".");
if [ \$CMACOUNT != 0 ]; then
mgmt_cli -r --port \$MGPORT true -d \$hostip show gateways-and-servers offset 0 limit 500 details-level full --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2 | grep -v 0.0.0. | sed -e "s/\$/ \$hostip/" >> /tmp/eview_topo;
fi
else
echo " Failed - "\$CMANAME_HA;
fi
done < /tmp/eview_MGTIP
echo;
else
# read SMS gateways
mgmt_cli -r --port \$MGPORT true show gateways-and-servers details-level full limit 500 offset 0 --format json | \$CPDIR/jq/jq -r '.objects[] | select(.type | contains("Member","simple-gateway")) | ."ipv4-address",."name" ' |xargs -n 2 | grep -v 0.0.0. |grep -v null | sed -e "s/\$/ x.x.x.x/" 2>&1> /tmp/eview_topo;
fi
######## GAIA Config save all gateways #########
if [ ! -f /tmp/eview_topo ]; then
echo "No gateways found!";
else
while read -r REMOTE_IP REMOTE_NAME REMOTE_CMA;
do
mdsenv \$REMOTE_CMA > /dev/null 2>&1;
echo "leer" > /tmp/eview_gateway_info.txt;
# echo \$REMOTE_IP \$REMOTE_NAME;
$CPDIR/bin/cprid_util -server \$REMOTE_IP putfile -local_file /usr/bin/eview_command -remote_file /var/log/eview_command.txt > /dev/null 2>&1;
$CPDIR/bin/cprid_util -server \$REMOTE_IP -verbose rexec -rcmd /bin/bash -f /var/log/eview_command.txt > /dev/null 2>&1;
$CPDIR/bin/cprid_util -server \$REMOTE_IP getfile -remote_file /var/log/eview_output1.txt -local_file /tmp/eview_gateway_info.txt > /dev/null 2>&1;
# cat /tmp/eview_gateway_info.txt;
echo -e "\e[7m";
# echo "\$REMOTE_NAME";
printf " %-77s" \$REMOTE_NAME;
echo -e "\e[0m"
# echo "Firewall | \$REMOTE_NAME (\$REMOTE_IP)";
printf '%.s-' {1..78};echo;
if grep -q leer /tmp/eview_gateway_info.txt; then
echo "Status | gateway down";
else
EVIEW_OS_OS=\`grep EVIEW_OS_OS /tmp/eview_gateway_info.txt | sed 's/EVIEW_OS_OS //g'\`; [ -z "\$EVIEW_OS_OS" ] && { EVIEW_OS_OS="-"; };
EVIEW_OS_KERNEL=\`grep EVIEW_OS_KERNEL /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_KERNEL" ] && { EVIEW_OS_KERNEL="-"; };
EVIEW_OS_BIT=\`grep EVIEW_OS_BIT /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_BIT" ] && { EVIEW_OS_BIT="-"; };
EVIEW_OS_JHF=\`grep EVIEW_OS_JHF /tmp/eview_gateway_info.txt | awk '{print \$2}'\`; [ -z "\$EVIEW_OS_JHF" ] && { EVIEW_OS_JHF="-"; };
EVIEW_OS_APP=\`grep EVIEW_OS_APP /tmp/eview_gateway_info.txt | sed 's/EVIEW_OS_APP //g'\`; [ -z "\$EVIEW_OS_APP" ] && { EVIEW_OS_APP="-"; };
echo "IP | \$REMOTE_IP";
echo "OS | \$EVIEW_OS_OS (\$EVIEW_OS_BIT Bit, Kernel \$EVIEW_OS_KERNEL, JHF \$EVIEW_OS_JHF) ";
echo "Hardware | \$EVIEW_OS_APP";
if [[ \$EVIEW_OS_OS == *"Embedded"* ]]; then
echo "Status | embedded (no more infos)";
else
EVIEW_CPU_CORES=\`grep EVIEW_CPU_CORES /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_CORES //g'\`; [ -z "\$EVIEW_CPU_CORES" ] && { EVIEW_CPU_CORES="-"; };
EVIEW_CPU_SPEED=\`grep EVIEW_CPU_SPEED /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_SPEED //g'\`; [ -z "\$EVIEW_CPU_SPEED" ] && { EVIEW_CPU_SPEED="-"; };
EVIEW_CPU_AESNI=\`grep EVIEW_CPU_AESNI /tmp/eview_gateway_info.txt | sed 's/EVIEW_CPU_AESNI //g'\`; [ -z "\$EVIEW_CPU_AESNI" ] && { EVIEW_CPU_AESNI="-"; };
echo -e "CPU | Cores: \$EVIEW_CPU_CORES \tSpeed: \$EVIEW_CPU_SPEED MHz \tAES-NI: \$EVIEW_CPU_AESNI";
EVIEW_FW_CON_NOW=\`grep EVIEW_FW_CON_NOW /tmp/eview_gateway_info.txt | sed 's/EVIEW_FW_CON_NOW //g'\`; [ -z "\$EVIEW_FW_CON_NOW" ] && { EVIEW_FW_CON_NOW="-"; };
EVIEW_FW_CON_MAX=\`grep EVIEW_FW_CON_MAX /tmp/eview_gateway_info.txt | sed 's/EVIEW_FW_CON_MAX //g'\`; [ -z "\$EVIEW_FW_CON_MAX" ] && { EVIEW_FW_CON_MAX="-"; };
EVIEW_POL_POL=\`grep VIEW_POL_POL /tmp/eview_gateway_info.txt | sed 's/VIEW_POL_POL //g'\`; [ -z "\$VIEW_POL_POL" ] && { VIEW_POL_POL="-"; };
EVIEW_POL_D=\`grep EVIEW_POL_D /tmp/eview_gateway_info.txt | sed 's/EVIEW_POL_D //g'\`; [ -z "\$EVIEW_POL_D" ] && { EVIEW_POL_D="-"; };
echo -e "Firewall | Policy: \$EVIEW_POL_POL \tDate: \$EVIEW_POL_D";
echo -e " | Connections: \$EVIEW_FW_CON_NOW (Max: \$EVIEW_FW_CON_MAX)";
EVIEW_BLADES_ENABLED=\`grep EVIEW_BLADES_ENABLED /tmp/eview_gateway_info.txt | sed 's/EVIEW_BLADES_ENABLED //g'\`; [ -z "\$EVIEW_BLADES_ENABLED" ] && { EVIEW_BLADES_ENABLED="-"; };
echo "Blades | \$EVIEW_BLADES_ENABLED";
echo "---------------+--------------------------------------------------------------";
EVIEW_CXL_STATUS=\`grep EVIEW_CXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_STATUS //g'\`; [ -z "\$EVIEW_CXL_STATUS" ] && { EVIEW_CXL_STATUS="-"; };
EVIEW_CXL_CORE=\`grep EVIEW_CXL_CORE /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_CORE //g'\`; [ -z "\$EVIEW_CXL_CORE" ] && { EVIEW_CXL_CORE="-"; };
EVIEW_CXL_LIC=\`grep EVIEW_CXL_LIC /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_LIC //g'\`; [ -z "\$EVIEW_CXL_LIC" ] && { EVIEW_CXL_LIC="-"; };
EVIEW_CXL_LOAD=\`grep EVIEW_CXL_LOAD /tmp/eview_gateway_info.txt | sed 's/EVIEW_CXL_LOAD //g'\`; [ -z "\$EVIEW_CXL_LOAD%" ] && { EVIEW_CXL_LOAD="-"; };
echo -e "CoreXL | Status: \$EVIEW_CXL_STATUS \tCores: \$EVIEW_CXL_CORE \tLicense: \$EVIEW_CXL_LIC \tAVG Load: \$EVIEW_CXL_LOAD";
EVIEW_SXL_STATUS=\`grep EVIEW_SXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_STATUS //g'\`; [ -z "\$EVIEW_SXL_STATUS" ] && { EVIEW_SXL_STATUS="-"; };
EVIEW_SXL_F2F=\`grep EVIEW_SXL_F2F /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_F2F //g'\`; [ -z "\$EVIEW_SXL_F2F" ] && { EVIEW_SXL_F2F="-"; };
EVIEW_SXL_MEDIUM=\`grep EVIEW_SXL_MEDIUM /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_MEDIUM //g'\`; [ -z "\$EVIEW_SXL_MEDIUM" ] && { EVIEW_SXL_MEDIUM="-"; };
EVIEW_SXL_FAST=\`grep EVIEW_SXL_FAST /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_FAST //g'\`; [ -z "\$EVIEW_SXL_FAST" ] && { EVIEW_SXL_FAST="-"; };
EVIEW_SXL_P_F2F=\`grep EVIEW_SXL_P_F2F /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_F2F //g'\`; [ -z "\$EVIEW_SXL_P_F2F" ] && { EVIEW_SXL_P_F2F="-"; };
EVIEW_SXL_P_MEDIUM=\`grep EVIEW_SXL_P_MEDIUM /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_MEDIUM //g'\`; [ -z "\$EVIEW_SXL_P_MEDIUM" ] && { EVIEW_SXL_P_MEDIUM="-"; };
EVIEW_SXL_P_FAST=\`grep EVIEW_SXL_P_FAST /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_P_FAST //g'\`; [ -z "\$EVIEW_SXL_P_FAST" ] && { EVIEW_SXL_P_FAST="-"; };
EVIEW_SXL_SND=\`grep EVIEW_SXL_SND /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_SND //g'\`; [ -z "\$EVIEW_SXL_SND" ] && { EVIEW_SXL_SND="-"; };
EVIEW_SXLHACPU_LOAD=\`grep EVIEW_SXLHACPU_LOAD /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXLHACPU_LOAD //g'\`; [ -z "\$EVIEW_SXLHACPU_LOAD" ] && { EVIEW_SXLHACPU_LOAD="-"; };
echo -e "SecureXL | Status: \$EVIEW_SXL_STATUS \tSND's: \$EVIEW_SXL_SND \t\t\tAVG Load: \$EVIEW_SXLHACPU_LOAD";
echo -e " | F2F: \$EVIEW_SXL_F2F \$EVIEW_SXL_P_F2F PXL: \$EVIEW_SXL_MEDIUM \$EVIEW_SXL_P_MEDIUM Accel: \$EVIEW_SXL_FAST \$EVIEW_SXL_P_FAST";
EVIEW_SXL_ACCEPT_T=\`grep EVIEW_SXL_ACCEPT_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_ACCEPT_T //g'\`; [ -z "\$EVIEW_SXL_ACCEPT_T" ] && { EVIEW_SXL_ACCEPT_T="-"; };
EVIEW_SXL_DROP_T=\`grep EVIEW_SXL_DROP_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_DROP_T //g'\`; [ -z "\$EVIEW_SXL_DROP_T" ] && { EVIEW_SXL_DROP_T="-"; };
EVIEW_SXL_NAT_T=\`grep EVIEW_SXL_NAT_T /tmp/eview_gateway_info.txt | sed 's/EVIEW_SXL_NAT_T //g'\`; [ -z "\$EVIEW_SXL_NAT_T" ] && { EVIEW_SXL_NAT_T="-"; };
echo -e "SXL Templates | Accept: \$EVIEW_SXL_ACCEPT_T";
echo -e " | Drop : \$EVIEW_SXL_DROP_T \tNAT: \$EVIEW_SXL_NAT_T";
EVIEW_MQ_STATUS=\`grep EVIEW_MQ_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_MQ_STATUS //g'\`; [ -z "\$EVIEW_MQ_STATUS" ] && { EVIEW_MQ_STATUS="-"; };
EVIEW_NET_10000_S=\`grep EVIEW_NET_10000_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_10000_S //g'\`; [ -z "\$EVIEW_NET_10000_S" ] && { EVIEW_NET_10000_S="no"; };
echo -e "Multi Queueing | Status: \$EVIEW_MQ_STATUS \t\t10GB Interface: \$EVIEW_NET_10000_S";
EVIEW_HT_S=\`grep EVIEW_HT_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_HT_S //g'\`; [ -z "\$EVIEW_HT_S" ] && { EVIEW_HT_S="-"; };
echo "Hyper Thread. | Status: \$EVIEW_HT_S";
EVIEW_DD_S=\`grep EVIEW_DD_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_DD_S //g'\`; [ -z "\$EVIEW_DD_S" ] && { EVIEW_DD_S="-"; };
echo "Dyn Dispatcher | Status: \$EVIEW_DD_S";
EVIEW_PQ_S=\`grep EVIEW_PQ_S /tmp/eview_gateway_info.txt | sed 's/EVIEW_PQ_S //g'\`; [ -z "\$EVIEW_PQ_S" ] && { EVIEW_PQ_S="-"; };
echo "Priority Queue | Status: \$EVIEW_PQ_S";
EVIEW_USERMODE=\`grep EVIEW_USERMODE /tmp/eview_gateway_info.txt | sed 's/EVIEW_USERMODE //g'\`; [ -z "\$EVIEW_USERMODE" ] && { EVIEW_USERMODE="-"; };
echo "Firewall Mode | Status: \$EVIEW_USERMODE";
echo "---------------+--------------------------------------------------------------";
EVIEW_CLXL_STATUS=\`grep EVIEW_CLXL_STATUS /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_STATUS //g'\`; [ -z "\$EVIEW_CLXL_STATUS" ] && { EVIEW_CLXL_STATUS="-"; };
EVIEW_CLXL_HA=\`grep EVIEW_CLXL_HA /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_HA //g'\`; [ -z "\$EVIEW_CLXL_HA" ] && { EVIEW_CLXL_HA="-"; };
EVIEW_CLXL_ID=\`grep EVIEW_CLXL_ID /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_ID //g'\`; [ -z "\$EVIEW_CLXL_ID" ] && { EVIEW_CLXL_ID="-"; };
EVIEW_CLXL_CCP=\`grep EVIEW_CLXL_CCP /tmp/eview_gateway_info.txt | sed 's/EVIEW_CLXL_CCP //g'\`; [ -z "\$EVIEW_CLXL_CCP" ] && { EVIEW_CLXL_CCP="-"; };
echo -e "ClusterXL | Status: \$EVIEW_CLXL_HA \tMode: \$EVIEW_CLXL_STATUS ";
echo -e " | Cluster ID: \$EVIEW_CLXL_ID \t\tCCP: \$EVIEW_CLXL_CCP ";
echo "---------------+--------------------------------------------------------------";
EVIEW_MEMT=\`grep EVIEW_MEMT /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMT //g'\`; [ -z "\$EVIEW_MEMT" ] && { EVIEW_MEMT="-"; };
EVIEW_MEMU=\`grep EVIEW_MEMU /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMU //g'\`; [ -z "\$EVIEW_MEMU" ] && { EVIEW_MEMU="-"; };
EVIEW_MEMF=\`grep EVIEW_MEMF /tmp/eview_gateway_info.txt | sed 's/EVIEW_MEMF //g'\`; [ -z "\$EVIEW_MEMF" ] && { EVIEW_MEMF="-"; };
echo -e "Memory | Total: \$EVIEW_MEMT MB \tUsed: \$EVIEW_MEMU MB \tFree: \$EVIEW_MEMF MB ";
EVIEW_SWAPT=\`grep EVIEW_SWAPT /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPT //g'\`; [ -z "\$EVIEW_SWAPT" ] && { EVIEW_SWAPT="-"; };
EVIEW_SWAPU=\`grep EVIEW_SWAPU /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPU //g'\`; [ -z "\$EVIEW_SWAPU" ] && { EVIEW_SWAPU="-"; };
EVIEW_SWAPF=\`grep EVIEW_SWAPF /tmp/eview_gateway_info.txt | sed 's/EVIEW_SWAPF //g'\`; [ -z "\$EVIEW_SWAPF" ] && { EVIEW_SWAPF="-"; };
echo -e "Swap | Total: \$EVIEW_SWAPT MB \tUsed: \$EVIEW_SWAPU MB \tFree: \$EVIEW_SWAPF MB ";
EVIEW_HD_ROOT_SIZE=\`grep EVIEW_HD_ROOT_SIZE /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_SIZE //g'\`; [ -z "\$EVIEW_HD_ROOT_SIZE" ] && { EVIEW_HD_ROOT_SIZE="-"; };
EVIEW_HD_ROOT_USED=\`grep EVIEW_HD_ROOT_USED /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_USED //g'\`; [ -z "\$EVIEW_HD_ROOT_USED" ] && { EVIEW_HD_ROOT_USED="-"; };
EVIEW_HD_ROOT_AVAIL=\`grep EVIEW_HD_ROOT_AVAIL /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_ROOT_AVAIL //g'\`; [ -z "\$EVIEW_HD_ROOT_AVAIL" ] && { EVIEW_HD_ROOT_AVAIL="-"; };
echo -e "HD / | Total: \$EVIEW_HD_ROOT_SIZE \t\tUsed: \$EVIEW_HD_ROOT_USED \tFree: \$EVIEW_HD_ROOT_AVAIL ";
EVIEW_HD_LOG_SIZE=\`grep EVIEW_HD_LOG_SIZE /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_SIZE //g'\`; [ -z "\$EVIEW_HD_LOG_SIZE" ] && { EVIEW_HD_LOG_SIZE="-"; };
EVIEW_HD_LOG_USED=\`grep EVIEW_HD_LOG_USED /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_USED //g'\`; [ -z "\$EVIEW_HD_LOG_USED" ] && { EVIEW_HD_LOG_USED="-"; };
EVIEW_HD_LOG_AVAIL=\`grep EVIEW_HD_LOG_AVAIL /tmp/eview_gateway_info.txt | sed 's/EVIEW_HD_LOG_AVAIL //g'\`; [ -z "\$EVIEW_HD_LOG_AVAIL" ] && { EVIEW_HD_LOG_AVAIL="-"; };
echo -e " /var/log | Total: \$EVIEW_HD_LOG_SIZE \t\tUsed: \$EVIEW_HD_LOG_USED \tFree: \$EVIEW_HD_LOG_AVAIL ";
if [[ \$NETWORK == "1" ]] ; then
echo "---------------+--------------------------------------------------------------";
EVIEW_NET_RXERR=\`grep EVIEW_NET_RXERR /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXERR //g'\`; [ -z "\$EVIEW_NET_RXERR" ] && { EVIEW_NET_RXERR="no"; };
EVIEW_NET_RXDRP=\`grep EVIEW_NET_RXDRP /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXDRP //g'\`; [ -z "\$EVIEW_NET_RXDRP" ] && { EVIEW_NET_RXDRP="no"; };
EVIEW_NET_RXOVR=\`grep EVIEW_NET_RXOVR /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_RXOVR //g'\`; [ -z "\$EVIEW_NET_RXOVR" ] && { EVIEW_NET_RXOVR="no"; };
EVIEW_NET_HALF=\`grep EVIEW_NET_HALF /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_HALF //g'\`; [ -z "\$EVIEW_NET_HALF" ] && { EVIEW_NET_HALF="no"; };
EVIEW_NET_UNSUP_DRIVER=\`grep EVIEW_NET_UNSUP_DRIVER /tmp/eview_gateway_info.txt | sed 's/EVIEW_NET_UNSUP_DRIVER //g'\`; [ -z "\$EVIEW_NET_UNSUP_DRIVER" ] && { EVIEW_NET_UNSUP_DRIVER="no"; };
echo -e "Network Errors | RX-ERR (>0.0%): \$EVIEW_NET_RXERR";
echo -e " | RX-DRP (>0.1%): \$EVIEW_NET_RXDRP";
echo -e " | RX-OVR (>0.1%): \$EVIEW_NET_RXOVR";
echo -e " | Half Duplex : \$EVIEW_NET_HALF";
echo -e " | Bad Driver : \$EVIEW_NET_UNSUP_DRIVER";
fi
if [[ \$REMOTEACCESS == "1" ]] ; then
echo "---------------+--------------------------------------------------------------";
EVIEW_RA_OMIP_NORM=\`grep EVIEW_RA_OMIP_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_OMIP_NORM //g'\`; [ -z "\$EVIEW_RA_OMIP_NORM" ] && { EVIEW_RA_OMIP_NORM="-"; };
EVIEW_RA_OMIP_PEAK=\`grep EVIEW_RA_OMIP_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_OMIP_PEAK //g'\`; [ -z "\$EVIEW_RA_OMIP_PEAK" ] && { EVIEW_RA_OMIP_PEAK="-"; };
EVIEW_RA_EPUSER_NORM=\`grep EVIEW_RA_EPUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_EPUSER_NORM //g'\`; [ -z "\$EVIEW_RA_EPUSER_NORM" ] && { EVIEW_RA_EPUSER_NORM="-"; };
EVIEW_RA_EPUSER_PEAK=\`grep EVIEW_RA_EPUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_EPUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_EPUSER_PEAK" ] && { EVIEW_RA_EPUSER_PEAK="-"; };
EVIEW_RA_CWUSER_NORM=\`grep EVIEW_RA_CWUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_CWUSER_NORM //g'\`; [ -z "\$EVIEW_RA_CWUSER_NORM" ] && { EVIEW_RA_CWUSER_NORM="-"; };
EVIEW_RA_CWUSER_PEAK=\`grep EVIEW_RA_CWUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_CWUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_CWUSER_PEAK" ] && { EVIEW_RA_CWUSER_PEAK="-"; };
EVIEW_RA_MABUSER_NORM=\`grep EVIEW_RA_MABUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_MABUSER_NORM //g'\`; [ -z "\$EVIEW_RA_MABUSER_NORM" ] && { EVIEW_RA_MABUSER_NORM="-"; };
EVIEW_RA_MABUSER_PEAK=\`grep EVIEW_RA_MABUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_MABUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_MABUSER_PEAK" ] && { EVIEW_RA_MABUSER_PEAK="-"; };
EVIEW_RA_L2TPUSER_NORM=\`grep EVIEW_RA_L2TPUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_L2TPUSER_NORM //g'\`; [ -z "\$EVIEW_RA_L2TPUSER_NORM" ] && { EVIEW_RA_L2TPUSER_NORM="-"; };
EVIEW_RA_L2TPUSER_PEAK=\`grep EVIEW_RA_L2TPUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_L2TPUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_L2TPUSER_PEAK" ] && { EVIEW_RA_L2TPUSER_PEAK="-"; };
EVIEW_RA_SNXUSER_NORM=\`grep EVIEW_RA_SNXUSER_NORM /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_SNXUSER_NORM //g'\`; [ -z "\$EVIEW_RA_SNXUSER_NORM" ] && { EVIEW_RA_SNXUSER_NORM="-"; };
EVIEW_RA_SNXUSER_PEAK=\`grep EVIEW_RA_SNXUSER_PEAK /tmp/eview_gateway_info.txt | sed 's/EVIEW_RA_SNXUSER_PEAK //g'\`; [ -z "\$EVIEW_RA_SNXUSER_PEAK" ] && { EVIEW_RA_SNXUSER_PEAK="-"; };
echo -e "Remote Access | Office Mode IP: \$EVIEW_RA_OMIP_NORM (Peak: \$EVIEW_RA_OMIP_PEAK) \tEndpoint VPN User: \$EVIEW_RA_EPUSER_NORM (Peak: \$EVIEW_RA_EPUSER_PEAK)";
echo -e " | CapsuleW. User: \$EVIEW_RA_CWUSER_NORM (Peak: \$EVIEW_RA_CWUSER_PEAK) \tMAB Portal User : \$EVIEW_RA_MABUSER_NORM (Peak: \$EVIEW_RA_MABUSER_PEAK)";
echo -e " | L2TP User : \$EVIEW_RA_L2TPUSER_NORM (Peak: \$EVIEW_RA_L2TPUSER_PEAK) \tSNX User : \$EVIEW_RA_SNXUSER_NORM (Peak: \$EVIEW_RA_SNXUSER_PEAK)";
fi
fi
if [[ \$SHOWFILE == "1" ]]; then
printf '%.s-' {1..78};echo;
cat /tmp/eview_gateway_info.txt;
fi
rm /tmp/eview_gateway_info.txt;
fi
echo; echo;
done < /tmp/eview_topo;
fi
echo;echo;
REMOTE_RM="\$FILE_PATH/202*";
rm \$REMOTE_RM > /dev/null 2>&1;
rm /tmp/g_command.txt > /dev/null 2>&1;
rm /tmp/eview_topo > /dev/null 2>&1;
rm /tmp/eview_MGTIP > /dev/null 2>&1;
rm /tmp/eview_migrate > /dev/null 2>&1;
rm /tmp/eview_mdsstatus > /dev/null 2>&1;
rm /tmp/eview_login > /dev/null 2>&1;
rm /tmp/inst_eview > /dev/null 2>&1;
EOT
cat <<EHA > /usr/bin/eview_command
#!/bin/bash
FWVER=\`cat /etc/cp-release | cut -c 18- | sed 's/^ *//g' | sed 's/\s*\$//g'\`;
# echo \$FWVER;
J=\`cpinfo -y all 2>/dev/null | grep JUMBO | tail -n1 | awk '{print \$3}'\`;
O=\`cat /etc/cp-release | cut -c 13- | sed 's/^ *//g' | sed 's/\s*$//g'\`;
OSM=\`uname -a | grep -c x86_64\`; [ \$OSM == 0 ] && { OSM=32; } || { OSM=64; };
K=\`uname -r | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/'\`;
T=\`cpstat os | grep "Appliance Name" | tr -s ' ' | cut -c 17- \`;
CPU_S=\`cat /proc/cpuinfo |grep processor | wc -l\`;
CPU_SP=\`cat /proc/cpuinfo | grep "cpu MHz" | head -1 | awk '{printf "%3.0f\n", \$4}'\`;
CPU_AESNI=\`grep -c aes /proc/cpuinfo\`; [ \$CPU_AESNI == 0 ] && { CPU_AESNI="off"; } || { CPU_AESNI="on"; };
USERMODE=\`cpprod_util FwIsUsermode\`; [ \$USERMODE == 0 ] && { USERMODE="Kernel Mode"; } || { USERMODE="User Mode"; };
CXL_S=\`fw ctl multik stat | wc -l\`; [ \$CXL_S == 0 ] && { CXL_S="off"; } || { CXL_S="on"; };
CXL_LIC=\`fw ctl affinity -corelicnum\`;
SXL_ACCEPT_T=\`fwaccel stat |grep "Accept Templates" | cut -d ':' -f2 | sed s/'\ '//;\`;
SXL_ACCEPT_RULE=\`fwaccel stat |grep "from rule #" | cut -d '#' -f2;\`;
SXL_DROP_T=\`fwaccel stat |grep "Drop Templates" | cut -d ':' -f2 | sed s/'\ '//;\`;
SXL_NAT_T=\`fwaccel stat |grep "NAT Templates" | cut -d ':' -f2 | sed s/'\ '//| awk '{print \$1}';\`;
if [[ \$SXL_ACCEPT_T == *"disabled by Firewall"* ]]; then
SXL_ACCEPT_T=\`echo "disabled (rule: \$SXL_ACCEPT_RULE)";\`;
fi
SXL_FP=\`fwaccel stats | grep "accel packets" | awk {'print \$3'}\`;
SXL_F2F=\`fwaccel stats | grep "F2F packets" | awk {'print \$3'}\`;
SXL_SND=\`fwaccel stat | grep SND | wc -l\`; [ \$SXL_SND == 0 ] && { SXL_SND="1"; }; # R80.10 fix
SXL_F2F_P=\`fwaccel stats -s | grep F2F |awk '{print \$6}'\`;
SXL_MP_P=\`fwaccel stats -s | grep "PXL pk\|PSLXL" |awk '{print \$6}'\`;
SXL_FP_P=\`fwaccel stats -s | grep "Accelerated pkt" |awk '{print \$6}'\`;
# SecureXL hack
if [[ \$FWVER == "R80.10" ]]; then
SXL_MP=\`fwaccel stats | grep "PXL packets" | awk {'print \$3'}\`;
SXL_S=\`fwaccel stat |grep "Accelerator Status" | awk {'print \$4'}\`; echo \$SXL_S;
# echo "R80.10:-)";
else
SXL_S=\`fwaccel stat | sed -n 4p | tr '|' ' ' | awk '{print \$3}'\`;[ \$SXL_S == "enabled" ] && { SXL_S="on"; } || { SXL_S="off"; };
SXL_MP=\`fwaccel stats | grep "PSLXL packets" | awk {'print \$6'}\`;
fi
typeset -i CXL_C; if [[ \$CXL_S == "on" ]]; then CXL_C=\`fw ctl multik stat | wc -l\`;CXL_C=\$CXL_C-2; else CXL_C=0; fi ;
# echo \$CXL_C;
BL=\`enabled_blades\`;
MQ_S=\`cpmq get -a | grep On | wc -l\`; [ \$MQ_S == "0" ] && { MQ_S="off"; } || { MQ_S="on"; }; echo \$MQ_S;
CLXL_S=\`cpstat -f all ha | grep "Working mode:" | sed 's/Working mode: //g' | sed 's/(Active Up)//g'\`;
CLXL_HA=\`cphaprob stat |grep local |awk {'print \$5'}\`;
CLXL_ID=\`cphaprob mmagic | grep "MAC magic:" |awk {'print \$3'}\`;
CLXL_CCP=\`cphaprob -a if | grep -c broadcast\`; [ \$CLXL_CCP == 0 ] && { CLXL_CCP=multicast; } || { CLXL_CCP=broadcast; };
DD_S=\`fw ctl multik dynamic_dispatching get_mode | sed 's/Current mode is //g'\`; [ \$DD_S == "On" ] && { DD_S="on"; } || { DD_S="off"; };
MEMT=\`free -m | grep Mem: | awk '{print \$2}'\`;
MEMU=\`free -m | grep Mem: | awk '{print \$3}'\`;
MEMF=\`free -m | grep Mem: | awk '{print \$4}'\`;
SWAPT=\`free -m | grep Swap: | awk '{print \$2}'\`;
SWAPU=\`free -m | grep Swap: | awk '{print \$3}'\`;
SWAPF=\`free -m | grep Swap: | awk '{print \$4}'\`;
HT_S=\`cat /proc/smt_status\`; [ \$HT_S == "Unsupported" ] && { HT_S="off (BIOS)"; };
HD_ROOT_SIZE=\`df -h / |grep % |grep -v Size |awk '{print \$1}'\`;
HD_ROOT_USED=\`df -h / |grep % |grep -v Size |awk '{print \$2}'\`;
HD_ROOT_AVAIL=\`df -h / |grep % |grep -v Size |awk '{print \$3}'\`;
HD_LOG_SIZE=\`df -h /var/log |grep % |grep -v Size |awk '{print \$1}'\`;
HD_LOG_USED=\`df -h /var/log |grep % |grep -v Size |awk '{print \$2}'\`;
HD_LOG_AVAIL=\`df -h /var/log |grep % |grep -v Size |awk '{print \$3}'\`;
# Load hack
if [[ \$USERMODE == "Kernel Mode" ]]; then
CXL_LOAD=\`top -b -n 1 |grep fw_worker | awk '{sum+=\$9}END{print sum}'\`;
else
CXL_LOAD=\`top -b -n 1 |grep fwk0_dev | awk '{print \$9}'\`;
fi
if [[ \$CXL_LOAD == "0" ]]; then
CXL_LOAD="1";
fi
#Load hack SXL
SXLHACPU=\`fw ctl affinity -l -a -v |grep Interface | awk '{print \$6}' | sort |uniq | awk '{LINEHA = LINEHA "|CPU"\$1} END {print LINEHA }' | sed s/\|//; \`;
SXLHACPU_C=\`sar -P ALL 1 1 | grep Average: |grep -v CPU |grep -v all | awk '{ print "CPU"\$2 " " 100-\$8}' |egrep \$SXLHACPU |wc -l;\`;
SXLHACPU_S=\`sar -P ALL 1 1 | grep Average: |grep -v CPU |grep -v all | awk '{ print "CPU"\$2 " " 100-\$8}' |egrep \$SXLHACPU | awk '{sum+=\$2} END {print sum}';\`;
SXLHACPU_LOAD=\`echo "scale=0; \$SXLHACPU_S/\$SXLHACPU_C" |bc ;\`;
# Network Errors
NET_RXERR=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$5+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.00001 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_RXDRP=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$6+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.1 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_RXOVR=\`netstat -in |grep -v Iface |awk '{ \$wert=sprintf(" %s %.6f", \$1, ((\$7+.000001)/(\$4+0.000001)*100))} {print \$wert}' | grep -v "100.000000" | awk '\$2 >.1 {print \$1}' | awk '{L=L \$1" "} END {print L}';\`;
NET_HALF=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Duplex|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "Half") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_10M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_100M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "100Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_1000M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "1000Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_10000_S=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10000Mb/s") { L="yes"}; } END {print L}' | sed s/://g;\`;
NET_10000M=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1)}' | egrep "Speed|Settings" |sed s/" (255)"// | xargs -n 5 | awk '{if (\$5 == "10000Mb/s") { L=L \$3" "}; } END {print L}' | sed s/://g;\`;
NET_UNSUP_DRIVER=\`cat /etc/udev/rules.d/00-OS-XX.rules | awk '{print \$2}' |sed s/NAME=// |sed s/\"//g | awk '{system("ethtool " \$1) system("ethtool -i " \$1) }' | egrep "Settings|driver|Link" | xargs -n 8 | grep yes| egrep "tg3|bge|bnx2|be2net" |awk '{ L=L \$3" ("\$8"), " } END {print L}' |sed s/://g| sed s/..\$//\`;
CXL_LOAD_INT=\`echo "scale=0; \$CXL_LOAD/\$CXL_C" |bc -l\`;
FW_CON_NOW=\`fw tab -t connections -s | grep localhost |awk '{print \$4}'\`;
FW_CON_MAX=\`fw tab -t connections -s | grep localhost |awk '{print \$5}'\`;
RA_OMIP_NORM=\`fw tab -t om_assigned_ips -s | grep localhost | awk '{print \$4}'\`;
RA_OMIP_PEAK=\`fw tab -t om_assigned_ips -s | grep localhost | awk '{print \$5}'\`;
RA_EPUSER_NORM=\`fw tab -t userc_users -s | grep localhost | awk '{print \$4}'\`;
RA_EPUSER_PEAK=\`fw tab -t userc_users -s | grep localhost | awk '{print \$5}'\`;
RA_CWUSER_NORM=\`fw tab -t mob_mail_session -s | grep localhost | awk '{print \$4}'\`;
RA_CWUSER_PEAK=\`fw tab -t mob_mail_session -s | grep localhost | awk '{print \$5}'\`;
RA_MABUSER_NORM=\`fw tab -t cvpn_session -s | grep localhost | awk '{print \$4}'\`;
RA_MABUSER_PEAK=\`fw tab -t cvpn_session -s | grep localhost | awk '{print \$5}'\`;
RA_L2TPUSER_NORM=\`fw tab -t L2TP_tunnels -s | grep localhost | awk '{print \$4}'\`;
RA_L2TPUSER_PEAK=\`fw tab -t L2TP_tunnels -s | grep localhost | awk '{print \$5}'\`;
RA_SNXUSER_NORM=\`fw tab -t sslt_om_ip_params -s | grep localhost | awk '{print \$4}'\`;
RA_SNXUSER_PEAK=\`fw tab -t sslt_om_ip_params -s | grep localhost | awk '{print \$5}'\`;
PQ_S=\`echo "3" | fw ctl multik prioq | grep "Current" |awk '{print tolower(\$4)}'\`;
POL_POL=\`fw stat |grep localhost | awk '{print \$2}'\`;
POL_D=\`fw stat |grep localhost | awk '{print \$3 " " \$4}'\`;
echo "EVIEW_OS_OS \${O}" > /var/log/eview_output1.txt;
echo "EVIEW_OS_KERNEL \${K}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_BIT \${OSM}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_JHF \${J}" >> /var/log/eview_output1.txt;
echo "EVIEW_OS_APP \${T}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_CORES \${CPU_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_SPEED \${CPU_SP}" >> /var/log/eview_output1.txt;
echo "EVIEW_CPU_AESNI \${CPU_AESNI}" >> /var/log/eview_output1.txt;
echo "EVIEW_BLADES_ENABLED \${BL}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_STATUS \${CXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_CORE \${CXL_C}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_LIC \${CXL_LIC}" >> /var/log/eview_output1.txt;
echo "EVIEW_CXL_LOAD \${CXL_LOAD_INT}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_STATUS \${SXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_F2F \${SXL_F2F}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_MEDIUM \${SXL_MP}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_FAST \${SXL_FP}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_F2F \${SXL_F2F_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_ACCEPT_T \${SXL_ACCEPT_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_DROP_T \${SXL_DROP_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_NAT_T \${SXL_NAT_T}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_MEDIUM \${SXL_MP_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_P_FAST \${SXL_FP_P}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXL_SND \${SXL_SND}" >> /var/log/eview_output1.txt;
echo "EVIEW_MQ_STATUS \${MQ_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_STATUS \${CLXL_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_HA \${CLXL_HA}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_ID \${CLXL_ID}" >> /var/log/eview_output1.txt;
echo "EVIEW_CLXL_CCP \${CLXL_CCP}" >> /var/log/eview_output1.txt;
echo "EVIEW_DD_S \${DD_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMT \${MEMT}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMU \${MEMU}" >> /var/log/eview_output1.txt;
echo "EVIEW_MEMF \${MEMF}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPT \${SWAPT}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPU \${SWAPU}" >> /var/log/eview_output1.txt;
echo "EVIEW_SWAPF \${SWAPF}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_SIZE \${HD_ROOT_SIZE}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_USED \${HD_ROOT_USED}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_ROOT_AVAIL \${HD_ROOT_AVAIL}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_SIZE \${HD_LOG_SIZE}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_USED \${HD_LOG_USED}" >> /var/log/eview_output1.txt;
echo "EVIEW_HD_LOG_AVAIL \${HD_LOG_AVAIL}" >> /var/log/eview_output1.txt;
echo "EVIEW_HT_S \${HT_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_USERMODE \${USERMODE}" >> /var/log/eview_output1.txt;
echo "EVIEW_FW_CON_NOW \${FW_CON_NOW}" >> /var/log/eview_output1.txt;
echo "EVIEW_FW_CON_MAX \${FW_CON_MAX}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_OMIP_NORM \${RA_OMIP_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_OMIP_PEAK \${RA_OMIP_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_EPUSER_NORM \${RA_EPUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_EPUSER_PEAK \${RA_EPUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_CWUSER_NORM \${RA_CWUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_CWUSER_PEAK \${RA_CWUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_MABUSER_NORM \${RA_MABUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_MABUSER_PEAK \${RA_MABUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_L2TPUSER_NORM \${RA_L2TPUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_L2TPUSER_PEAK \${RA_L2TPUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_SNXUSER_NORM \${RA_SNXUSER_NORM}" >> /var/log/eview_output1.txt;
echo "EVIEW_RA_SNXUSER_PEAK \${RA_SNXUSER_PEAK}" >> /var/log/eview_output1.txt;
echo "EVIEW_PQ_S \${PQ_S}" >> /var/log/eview_output1.txt;
echo "EVIEW_POL_POL \${POL_POL}" >> /var/log/eview_output1.txt;
echo "EVIEW_POL_D \${POL_D}" >> /var/log/eview_output1.txt;
echo "EVIEW_SXLHACPU_LOAD \$SXLHACPU_LOAD" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXERR \$NET_RXERR" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXDRP \$NET_RXDRP" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_RXOVR \$NET_RXOVR" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_HALF \$NET_HALF" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10M \$NET_10M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_100M \$NET_100M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_1000M \$NET_1000M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10000M \$NET_10000M" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_10000_S \$NET_10000_S" >> /var/log/eview_output1.txt;
echo "EVIEW_NET_UNSUP_DRIVER \$NET_UNSUP_DRIVER" >> /var/log/eview_output1.txt;
echo "END" >> /var/log/eview_output1.txt;
EHA
chmod 770 /usr/bin/eview;
chmod 770 /usr/bin/eview_command;
More "Easy Tools":
- Easy Backup Tool - (migrate export + all GAIA configs) -> Easy backup of all gateway GAIA configs + migrate export with one CLI command. - Easy execute CLI commands on all gateways simultaneously -> Now you can use the new command to execute bash or clish commands on all gateway simultaneously. - Easy execute CLI commands from management on gateways -> Easy execute CLI commands from management on gateways - Mobile User License Tool - replaced "dtps lic" -> It displays all Secure Client, SSL VPN and Mobile Access Portal licenses in total (sum) on the SMS. - Easy View Tool - (system infos from all gateways simultaneously) -> This toll shows you quickly an overview of status information of all your gateways with only one CLI command.
Version:
0.1 04-08-2020 Beta 0.2 04-09-2020 add many new parameter (HW, Blades, MQ, HT, OS, CoreXL) 0.3 04-10-2020 add parameter (SecureXL, ClusterXL, Dynamic Dispatcher, Firewall, Memorry, HD, Firewall Mode) 0.4 04-11-2020 add parameter (Remote Access) 0.5 04-11-2020 add parameter (firewall policy and date) add SecureXL AVG Load (SecureXL has cost me my nerves:-) 0.6 04-12-2020 add network errors (RX-ERR, RX-OVR, RX-DRP) 0.7 04-13-2020 add half duplex errors, MQ and 10GB Interfaces (yes/no), interfaces with bad/unsupported driver 0.8 04-15-2020 bug fixed SXL AVG load, CXL AVG load,... add SXL Accept-, Drop- and NAT-Templates
➜ CCSM Elite, CCME, CCTE ➜ www.checkpoint.tips