From b5f8ee61a7f7e9bd291dd26b0585d03eb686c941 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 13:19:16 +0200 Subject: Adding upstream version 1.46.3. Signed-off-by: Daniel Baumann --- collectors/tc.plugin/tc-qos-helper.sh.in | 356 ------------------------------- 1 file changed, 356 deletions(-) delete mode 100755 collectors/tc.plugin/tc-qos-helper.sh.in (limited to 'collectors/tc.plugin/tc-qos-helper.sh.in') diff --git a/collectors/tc.plugin/tc-qos-helper.sh.in b/collectors/tc.plugin/tc-qos-helper.sh.in deleted file mode 100755 index 3298c39a3..000000000 --- a/collectors/tc.plugin/tc-qos-helper.sh.in +++ /dev/null @@ -1,356 +0,0 @@ -#!/usr/bin/env bash - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2023 Netdata Inc. -# SPDX-License-Identifier: GPL-3.0-or-later -# -# This script is a helper to allow netdata collect tc data. -# tc output parsing has been implemented in C, inside netdata -# This script allows setting names to dimensions. - -export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin:@sbindir_POST@" -export LC_ALL=C - -cmd_line="'${0}' $(printf "'%s' " "${@}")" - -# ----------------------------------------------------------------------------- -# logging - -PROGRAM_NAME="$(basename "${0}")" -PROGRAM_NAME="${PROGRAM_NAME/.plugin/}" - -# these should be the same with syslog() priorities -NDLP_EMERG=0 # system is unusable -NDLP_ALERT=1 # action must be taken immediately -NDLP_CRIT=2 # critical conditions -NDLP_ERR=3 # error conditions -NDLP_WARN=4 # warning conditions -NDLP_NOTICE=5 # normal but significant condition -NDLP_INFO=6 # informational -NDLP_DEBUG=7 # debug-level messages - -# the max (numerically) log level we will log -LOG_LEVEL=$NDLP_INFO - -set_log_min_priority() { - case "${NETDATA_LOG_LEVEL,,}" in - "emerg" | "emergency") - LOG_LEVEL=$NDLP_EMERG - ;; - - "alert") - LOG_LEVEL=$NDLP_ALERT - ;; - - "crit" | "critical") - LOG_LEVEL=$NDLP_CRIT - ;; - - "err" | "error") - LOG_LEVEL=$NDLP_ERR - ;; - - "warn" | "warning") - LOG_LEVEL=$NDLP_WARN - ;; - - "notice") - LOG_LEVEL=$NDLP_NOTICE - ;; - - "info") - LOG_LEVEL=$NDLP_INFO - ;; - - "debug") - LOG_LEVEL=$NDLP_DEBUG - ;; - esac -} - -set_log_min_priority - -log() { - local level="${1}" - shift 1 - - [[ -n "$level" && -n "$LOG_LEVEL" && "$level" -gt "$LOG_LEVEL" ]] && return - - systemd-cat-native --log-as-netdata --newline="--NEWLINE--" </dev/null)" - [ -n "${l}" ] && tc_devices="${tc_devices} ${dev}" - done -} - -# update devices and class names -# once every 2 minutes -names_every=$((qos_get_class_names_every / update_every)) - -# exit this script every hour -# it will be restarted automatically -exit_after=$((qos_exit_every / update_every)) - -c=0 -gc=0 -while true; do - fix_names= - c=$((c + 1)) - gc=$((gc + 1)) - - if [ ${c} -le 1 ] || [ ${c} -ge ${names_every} ]; then - c=1 - fix_names="YES" - find_tc_devices - fi - - for d in ${tc_devices}; do - show_tc "${d}" - done - - echo "WORKTIME ${LOOPSLEEPMS_LASTWORK}" || exit - - loopsleepms "${update_every}" - - [ ${gc} -gt ${exit_after} ] && exit 0 -done -- cgit v1.2.3