feat:add packet-io data path trace config arg

This commit is contained in:
linxin
2024-03-12 18:16:16 +08:00
committed by 付明卫
parent 82581b937c
commit 6335db2ffe
2 changed files with 22 additions and 0 deletions

View File

@@ -132,13 +132,29 @@ dp_trace_file_max_size_in_KB={{getv "/datapath_trace/datapath_trace_file_max_siz
{{$num:="" -}}
{{range $key, $dir := lsdir "/datapath_trace/rule"}}
{{- $index:= len $num -}}
{{- $rule_enable_path := printf "/datapath_trace/rule/%d/enable" $index -}}
{{- $rule_enable := getv $rule_enable_path -}}
{{- $bpf_expr := printf "/datapath_trace/rule/%d/bpf_expr" $index -}}
{{- $packet_max_count := printf "/datapath_trace/rule/%d/packet_max_count" $index -}}
{{- $sampling := printf "/datapath_trace/rule/%d/sampling" $index -}}
{{- $snaplen := printf "/datapath_trace/rule/%d/snaplen" $index -}}
{{- $id := printf "/datapath_trace/rule/%d/id" $index -}}
{{- $num = printf "%s1" $num }}
[dp_trace_rule:{{getv $id}}]
{{- if eq $rule_enable "yes" }}
enable=1
{{- end}}
{{- if eq $rule_enable "no" }}
enable=0
{{- end}}
bpf_expr={{getv $bpf_expr}}
{{- if exists $packet_max_count }}
pkt_cnt_max={{getv $packet_max_count}}
{{- end }}
{{- if exists $sampling }}
sampling={{getv $sampling}}
{{- end }}
{{- if exists $snaplen }}
snaplen={{getv $snaplen}}
{{- end }}
{{ end -}}

View File

@@ -149,3 +149,9 @@
name: dnsutils
conf_file: "{{ rpm_repo_config_path }}"
state: present
- name: "install wireshark"
yum:
name: wireshark
conf_file: "{{ rpm_repo_config_path }}"
state: present