From 38649d317908347cb884db641b29ef148c55be01 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 3 Dec 2021 12:57:13 +0100 Subject: [PATCH] translated comments form german to englisch --- plugins/router/mikrotik_system | 54 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/plugins/router/mikrotik_system b/plugins/router/mikrotik_system index 04841e31..a6809247 100755 --- a/plugins/router/mikrotik_system +++ b/plugins/router/mikrotik_system @@ -39,11 +39,11 @@ munin-node. =cut EOF -# setze Variablen mit default-Werten +# set variables with default values ssh_user=${ssh_user:-user} ssh_password=${ssh_password:-password} ssh_host=${ssh_host:-192.168.2.1} -c=0 # zähler; wird für verschiedene Schleifen benötigt +c=0 # counter, it is used in a few loops # Function to get stderr from command # USAGE: catch STDOUT STDERR cmd args.. @@ -63,7 +63,7 @@ printf '( exit %q )' "$ret" >&2; } 2>&1 )"; } -# Funktionen +# functions function get_name { while read -r line; do if echo "$line" | grep -q 'name:'; then @@ -90,7 +90,7 @@ function get_cpu_count { done <<< "$data" } function get_data { - # hole daten per ssh + # fetch data per ssh catch data stderr sshpass -p "$ssh_password" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_user"@"$ssh_host" ':delay 6s; /system health print; /system resource print; /system resource cpu print; /system identity print' data_ret=$? } @@ -115,12 +115,12 @@ function get_mem_free { } function get_voltage_label { - while read -r line; do # für jede zeile in... ; siehe "done" - # gebe die zeile aus - # suche mit awk nach "voltage:" - # wenn gefunden: - # gebe jede zeile per print text aus - # externe/bash-variablen mit "'""'" + while read -r line; do # for every line + # output line + # search with awk for "voltage:" + # if found + # print line + # external/bash-variables with "'""'" echo "$line" | awk '/voltage:/{ print "multigraph voltage_graph_""'"$name"'"; print "graph_title voltage " "'"$name"'"; @@ -134,17 +134,16 @@ function get_voltage_label { } function get_voltage_value { while read -r line; do - # funktion wie bei den "label"-funktionen - # gib überschrift aus wenn dirtyconfig nicht gesetzt ist - # weil aufruf dann nicht in "config" erfolgt - # wenn dirtyconfig nicht gesetzt ist oder =0, gebe überschrift aus + # like the label functions + # print title if dirtyconfig is not set + # because the call does not come in "config" if [ "$MUNIN_CAP_DIRTYCONFIG" = "0" ] || [ -z "$MUNIN_CAP_DIRTYCONFIG" ]; then echo "$line" | awk '/voltage:/{ print "multigraph voltage_graph_""'"$name"'"; }' fi - # entferne mit gsub das zeichen % in wert $2 - # gebe $2 aus + # remove with gsub the char % in argument $2 + # print $2 echo "$line" | awk '/voltage:/{ gsub(/V/,"",$2); print "voltage.value " $2 @@ -354,9 +353,15 @@ function get_memory_value { printf "free_memory.value %.0f\n", $2 }' done <<< "$data" +<<<<<<< HEAD # berechne used-memory # gesamt + frei = benutzt printf "used_memory.value %.0f\n" "$(echo $mem_total $mem_free | awk '{print ($1 - $2)}')" +======= + # calculate used-memory + # total - free = used + echo used_memory.value "$(echo $mem_total $mem_free | awk '{print ($1 - $2)}')" +>>>>>>> fc66f426 (translated comments form german to englisch) } function get_disk_label { @@ -392,13 +397,13 @@ function get_disk_value { done <<< "$data" } -# rufe funktionen auf, reihenfolge ist wichtig +# call functions, the order is important get_data validate_data get_name get_cpu_count -# munin-Logik -# wenn $1 = X; dann +# munin-Logic +# id $1 = X; then if [ "$1" = "autoconf" ]; then if ! command -v sshpass &> /dev/null; then echo "[ERROR] sshpass could not be found!" @@ -408,8 +413,8 @@ if [ "$1" = "autoconf" ]; then exit 0 fi if [ "$1" = "config" ]; then - # gebe label aus - # wenn dirtyconfig gesetzt rufe value funktion auf + # print label + # if dirtyconfig is set print the value get_voltage_label if [ "$MUNIN_CAP_DIRTYCONFIG" = "1" ]; then get_voltage_value @@ -444,8 +449,7 @@ if [ "$1" = "config" ]; then fi exit 0 fi -# wird nie aufgerufen wenn dirtyconfig gesetzt ist -# dann wird nur config aufgerufen und dabei werden zusätzlich die values ausgegeben +# does not get called if dirtyconfig is set get_voltage_value get_bad_blocks_value get_write_sect_total_value @@ -456,7 +460,7 @@ get_memory_value get_disk_value exit 0 -# Beispieloutput ROS 6.4* +# Example Output ROS 6.4* # voltage: 24.5V # cpu-temperature: 31C # uptime: 4w3d21h28m58s @@ -482,7 +486,7 @@ exit 0 # 1 cpu1 19% 0% 0% # name: crs309 -# Beispieloutput ROS 7* +# Example Output ROS 7* # Columns: NAME, VALUE, TYPE # # NAME VA T # 0 cpu-temperature 44 C