Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

ONELINER - SecureXL and CoreXL AVG Load

This oneliner (see spoiler) shows you the average CPU time of all CoreXL and SecureXL instances.

Spoiler
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=2; $SXLHACPU_S/$SXLHACPU_C" |bc `; echo; echo "SecureXL AVG Load: $SXLHACPU_LOAD %"; U=`cpprod_util FwIsUsermode`; if [ $U == "0" ]; 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 ;typeset -i CXL_C; CXL_C=`fw ctl multik stat | wc -l`;CXL_C=$CXL_C-2; CXL_LOAD_INT=`echo "scale=2; $CXL_LOAD/$CXL_C" |bc -l`; echo "CoreXL AVG Load  : $CXL_LOAD_INT %";

 Output:
CLXL.JPG

Or use this tool for much more information on all your gateways :
Easy View Tool - View System Info for All Gateways Simultaneously

9 Replies
Highlighted

Just tested in my lab with R80.40 und USFW and it is not working, as there is no fw_worker 😉
0 Kudos
Highlighted

Hi @Norbert_Bohusch,

Now I check if the FW works as KMFW or as UMFW!
Accordingly I check the fw_worker or the fwk0_dev process.

THX
Heiko

Tags (1)
Highlighted

Thanks Heiko, but there is still a bug 🙂

Here the output (securexl avg always 100%):

Spoiler
SecureXL AVG Load: 100.00 %
-bash: [: 6.2==: unary operator expected
CoreXL AVG Load : 2.06 %

I expect mpstat is different:

Spoiler

[Expert@nb-ckp-gw1:0]# mpstat -P ALL
Linux 3.10.0-957.21.3cpx86_64 (nb-ckp-gw1) 04/14/20 _x86_64_ (4 CPU)

14:07:53 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
14:07:53 all 1.55 0.00 1.60 0.03 0.26 0.20 0.00 0.00 0.00 96.36
14:07:53 0 0.12 0.00 0.05 0.03 0.31 0.55 0.00 0.00 0.00 98.94
14:07:53 1 1.53 0.00 1.95 0.02 0.22 0.09 0.00 0.00 0.00 96.18
14:07:53 2 2.08 0.00 2.02 0.05 0.24 0.08 0.00 0.00 0.00 95.53
14:07:53 3 2.47 0.01 2.36 0.05 0.25 0.09 0.00 0.00 0.00 94.77

 

Highlighted

With the 3.10 kernel idle is on position 12 and with the 2.6 kernel on position 10.

I will modify the script again soon.

Highlighted

Hi @Norbert_Bohusch ,

Now with "sar" instead of "mpstat".
Should work now.

Can you test it?

Thanks
Heiko

Tags (1)
0 Kudos
Highlighted

Tested it and also not working. But I have found the reason as well.
sar has the following syntax:
# sar [ options ] [ <interval> [ <count> ] ]
In kernel 3.10 R80.40 it is not using your "sar -P ALL 1" as count 1, but interval 1. But this should be correct according to the way the brackets are shown. In kernel 2.6 it is taken as count and therefor works.
You can fix it by using "sar -P ALL 1 1"
Highlighted

👍 Done!

Thanks
Heiko

Highlighted

I tested it:

 3.10 /2.6 kernel 

USFW and KMFW

R80.10, R80.30

Highlighted

Thanks, also working with R80.40 JHF 25 and USFW.