proxy_maat_stat.sh脚本用于查看代理配置的加载

This commit is contained in:
fengweihao
2024-04-09 19:07:43 +08:00
committed by 冯伟浩
parent 5851c46103
commit 93c626de6d
6 changed files with 49 additions and 204 deletions

View File

@@ -0,0 +1,47 @@
#!/bin/bash
ARGC=$#
EXPORTER=/opt/tsg/framework/bin/fieldstat_exporter.py
TARGET=/opt/tsg/tfe/log/pangu_scan.fs2
case $1 in
-h|--help)
echo "$0"
echo "Usage: [exporter] [target]"
echo " exporter: path of exporter, default is $EXPORTER"
echo " target: path of target file, default is $TARGET"
exit 0
;;
esac
case $ARGC in
1)
EXPORTER=$1
;;
2)
EXPORTER=$1
TARGET=$2
;;
esac
python3 $EXPORTER local -j $TARGET -e -t '
{{
print_tables
(
"TBL",
[
"rule",
"reg/v6",
"scan_times",
"hit_times",
"scan_bytes",
"scan_cpu_time",
"hit_item_num",
"hit_pat_num",
"#Name<IN_Bps>#Ratio<scan_bytes,scan_cpu_time,100>",
"#Name<hit_rate>#Ratio<hit_times,scan_times,1>"
],
False
)
}}
'