diff --git a/VERSION b/VERSION index 10582ea..cb4f71a 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -9.2.0.5 -9.2.0.5 +9.2.0.6 +9.2.0.6 diff --git a/app.manifest b/app.manifest index 85496fd..8eae928 100644 --- a/app.manifest +++ b/app.manifest @@ -29,7 +29,7 @@ "id": { "group": null, "name": "TA-nix", - "version": "9.2.0.5" + "version": "9.2.0.6" }, "license": { "name": "Splunk Software License Agreement", diff --git a/bin/docker.sh b/bin/docker.sh index 9369605..96a3d51 100755 --- a/bin/docker.sh +++ b/bin/docker.sh @@ -62,8 +62,19 @@ for id in $docker_list; do pids[$id]=$($docker_cmd inspect -f '{{ .State.Pid }}' $id) read time_start[$id] _ < /proc/uptime read _ cpu_start[$id] < /sys/fs/cgroup/system.slice/docker-$id.scope/cpu.stat - while read _if _rx _ _ _ _ _ _ _ _tx _ _ _ _ _ _ _ ; do if=$_if rx_start[$id]=$_rx tx_start[$id]=$_tx; done < /proc/${pids[$id]}/net/dev - br_start[$id]=0;bw_start[$id]=0;while read _ _br _bw _ _ _ _; do br_start[$id]=$((${br_start[$id]}+${_br:7}));bw_start[$id]=$((${bw_start[$id]}+${_bw:7})); done < /sys/fs/cgroup/system.slice/docker-$id.scope/io.stat + while read _if _rx _ _ _ _ _ _ _ _tx _ _ _ _ _ _ _ ; do + [ -z "$_if" ] && continue + [ -z "$_rx" ] && _rx=0 + [ -z "$_tx" ] && _tx=0 + if=$_if rx_start[$id]=$_rx tx_start[$id]=$_tx + done < /proc/${pids[$id]}/net/dev + br_start[$id]=0;bw_start[$id]=0 + while read _ _br _bw _ _ _ _; do + [ -z "$_br" ] && _br=rbytes=0 + [ -z "$_bw" ] && _bw=wbytes=0 + br_start[$id]=$((${br_start[$id]}+${_br:7})) + bw_start[$id]=$((${bw_start[$id]}+${_bw:7})) + done < /sys/fs/cgroup/system.slice/docker-$id.scope/io.stat done sleep 2 # Sleep 2 seconds to give the script time to get CPU stats @@ -78,8 +89,19 @@ for id in $docker_list; do fi read cpu_stop _ < /proc/uptime read _ proc_stop < /sys/fs/cgroup/system.slice/docker-$id.scope/cpu.stat - while read _if _rx _ _ _ _ _ _ _ _tx _ _ _ _ _ _ _ ; do if=$_if NetRX=$_rx NetTX=$_tx; done < /proc/${pids[$id]}/net/dev - BlockRead=0;BlockWrite=0;while read _ _br _bw _ _ _ _; do BlockRead=$((BlockRead+${_br:7}));BlockWrite=$((BlockWrite+${_bw:7})); done < /sys/fs/cgroup/system.slice/docker-$id.scope/io.stat + while read _if _rx _ _ _ _ _ _ _ _tx _ _ _ _ _ _ _ ; do + [ -z "$_if" ] && continue + [ -z "$_rx" ] && _rx=0 + [ -z "$_tx" ] && _tx=0 + if=$_if NetRX=$_rx NetTX=$_tx + done < /proc/${pids[$id]}/net/dev + BlockRead=0;BlockWrite=0 + while read _ _br _bw _ _ _ _; do + [ -z "$_br" ] && _br=rbytes=0 + [ -z "$_bw" ] && _bw=wbytes=0 + BlockRead=$((BlockRead+${_br:7})) + BlockWrite=$((BlockWrite+${_bw:7})) + done < /sys/fs/cgroup/system.slice/docker-$id.scope/io.stat read MemUsage < /sys/fs/cgroup/system.slice/docker-$id.scope/memory.current read Pids < /sys/fs/cgroup/system.slice/docker-$id.scope/pids.current read _ CPU < /sys/fs/cgroup/cpu.stat diff --git a/default/app.conf b/default/app.conf index 019e7b8..75677db 100644 --- a/default/app.conf +++ b/default/app.conf @@ -17,7 +17,7 @@ docs_section_override = AddOns:released [launcher] author = Michael Erdely -version = 9.2.0.5 +version = 9.2.0.6 description = Technical Add-on for Unix and Linux #[package] @@ -26,5 +26,5 @@ description = Technical Add-on for Unix and Linux [id] name = TA-unix -version = 9.2.0.5 +version = 9.2.0.6 diff --git a/default/props.conf b/default/props.conf index efcfa40..417652d 100644 --- a/default/props.conf +++ b/default/props.conf @@ -517,7 +517,7 @@ KV_MODE=multi [docker] SHOULD_LINEMERGE=false -LINE_BREAKER=(^$|[\r\n]+[\r\n]+) +LINE_BREAKER=(^$|[\r\n]+) TRUNCATE=1000000 KV_MODE = json FIELDALIAS-dest_for_docker = host as dest diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index a30babf..8377af6 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,5 +1,14 @@ # Technical Add-on for Unix and Linux +## Version 9.2.0.6 (2025-01-17) + +Fix docker script and props + +Changes: + +* Fix output for docker script (handle lines that didn't have values) +* Fix props.conf LINE_BREAKER for docker + ## Version 9.2.0.5 (2025-01-11) Add script for docker events/metrics and support running TA outside of Splunk