X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=x2%2Fsrc%2Fbash%2Fexe%2Fkhatus.sh;h=10ddcebba78369962fb640597014dbffd78dde67;hb=dbdf0f7b374e9fdde3804fc11f25f5f60ccb5c88;hp=6526ab5c4144f62123cccd471a3bebc2f943f84b;hpb=01da02dd035f18586b3435743c6840ad77ba62b9;p=khatus.git diff --git a/x2/src/bash/exe/khatus.sh b/x2/src/bash/exe/khatus.sh index 6526ab5..10ddceb 100644 --- a/x2/src/bash/exe/khatus.sh +++ b/x2/src/bash/exe/khatus.sh @@ -85,6 +85,19 @@ fork_poller() { done & } +find_thermal_zone() { + local -r _type="$1" + awk \ + -v _type="$_type" \ + ' + $0 ~ ("^" _type "$") { + split(FILENAME, f, "thermal_zone"); + split(f[2], f2, "/"); + print f2[1]} + ' \ + /sys/class/thermal/thermal_zone*/type +} + main() { declare -A opts=( ["--node"]=$(hostname) @@ -96,7 +109,7 @@ main() { ["--wifi_interface"]='' ["--disk_space_device"]='/' ["--disk_io_device"]='sda' - ["--thermal_zone"]=0 + ["--thermal_zone"]="$(find_thermal_zone x86_pkg_temp)" ["--fan_path"]='/proc/acpi/ibm/fan' ["--pulseaudio_sink"]='0' ["--interval_datetime"]=1 @@ -200,6 +213,7 @@ main() { fork_poller "${opts['--interval_mpd']}" "$perf" "$pipe" "$bin" "$cmd_sens_mpd" fork_poller "${opts['--interval_volume']}" "$perf" "$pipe" "$bin" "$cmd_sens_volume" fork_poller "${opts['--interval_bluetooth']}" "$perf" "$pipe" "$bin" "$cmd_sens_bluetooth" + fork_poller "${opts['--interval_bluetooth']}" "$perf" "$pipe" "$bin" 'khatus_sensor_bluetooth' fork_poller "${opts['--interval_net_wifi']}" "$perf" "$pipe" "$bin" "$cmd_sens_wifi" fork_poller "${opts['--interval_net_io']}" "$perf" "$pipe" "$bin" "$cmd_sens_net_addr_io" fork_poller "${opts['--interval_disk_space']}" "$perf" "$pipe" "$bin" "$cmd_sens_disk_space"