mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
translated comments form german to englisch
This commit is contained in:
parent
74b7eb2a46
commit
38649d3179
1 changed files with 29 additions and 25 deletions
|
@ -39,11 +39,11 @@ munin-node.
|
||||||
=cut
|
=cut
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# setze Variablen mit default-Werten
|
# set variables with default values
|
||||||
ssh_user=${ssh_user:-user}
|
ssh_user=${ssh_user:-user}
|
||||||
ssh_password=${ssh_password:-password}
|
ssh_password=${ssh_password:-password}
|
||||||
ssh_host=${ssh_host:-192.168.2.1}
|
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
|
# Function to get stderr from command
|
||||||
# USAGE: catch STDOUT STDERR cmd args..
|
# USAGE: catch STDOUT STDERR cmd args..
|
||||||
|
@ -63,7 +63,7 @@ printf '( exit %q )' "$ret" >&2;
|
||||||
} 2>&1 )";
|
} 2>&1 )";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Funktionen
|
# functions
|
||||||
function get_name {
|
function get_name {
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
if echo "$line" | grep -q 'name:'; then
|
if echo "$line" | grep -q 'name:'; then
|
||||||
|
@ -90,7 +90,7 @@ function get_cpu_count {
|
||||||
done <<< "$data"
|
done <<< "$data"
|
||||||
}
|
}
|
||||||
function get_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'
|
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=$?
|
data_ret=$?
|
||||||
}
|
}
|
||||||
|
@ -115,12 +115,12 @@ function get_mem_free {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_voltage_label {
|
function get_voltage_label {
|
||||||
while read -r line; do # für jede zeile in... ; siehe "done"
|
while read -r line; do # for every line
|
||||||
# gebe die zeile aus
|
# output line
|
||||||
# suche mit awk nach "voltage:"
|
# search with awk for "voltage:"
|
||||||
# wenn gefunden:
|
# if found
|
||||||
# gebe jede zeile per print text aus
|
# print line
|
||||||
# externe/bash-variablen mit "'"<var>"'"
|
# external/bash-variables with "'"<var>"'"
|
||||||
echo "$line" | awk '/voltage:/{
|
echo "$line" | awk '/voltage:/{
|
||||||
print "multigraph voltage_graph_""'"$name"'";
|
print "multigraph voltage_graph_""'"$name"'";
|
||||||
print "graph_title voltage " "'"$name"'";
|
print "graph_title voltage " "'"$name"'";
|
||||||
|
@ -134,17 +134,16 @@ function get_voltage_label {
|
||||||
}
|
}
|
||||||
function get_voltage_value {
|
function get_voltage_value {
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
# funktion wie bei den "label"-funktionen
|
# like the label functions
|
||||||
# gib überschrift aus wenn dirtyconfig nicht gesetzt ist
|
# print title if dirtyconfig is not set
|
||||||
# weil aufruf dann nicht in "config" erfolgt
|
# because the call does not come in "config"
|
||||||
# wenn dirtyconfig nicht gesetzt ist oder =0, gebe überschrift aus
|
|
||||||
if [ "$MUNIN_CAP_DIRTYCONFIG" = "0" ] || [ -z "$MUNIN_CAP_DIRTYCONFIG" ]; then
|
if [ "$MUNIN_CAP_DIRTYCONFIG" = "0" ] || [ -z "$MUNIN_CAP_DIRTYCONFIG" ]; then
|
||||||
echo "$line" | awk '/voltage:/{
|
echo "$line" | awk '/voltage:/{
|
||||||
print "multigraph voltage_graph_""'"$name"'";
|
print "multigraph voltage_graph_""'"$name"'";
|
||||||
}'
|
}'
|
||||||
fi
|
fi
|
||||||
# entferne mit gsub das zeichen % in wert $2
|
# remove with gsub the char % in argument $2
|
||||||
# gebe $2 aus
|
# print $2
|
||||||
echo "$line" | awk '/voltage:/{
|
echo "$line" | awk '/voltage:/{
|
||||||
gsub(/V/,"",$2);
|
gsub(/V/,"",$2);
|
||||||
print "voltage.value " $2
|
print "voltage.value " $2
|
||||||
|
@ -354,9 +353,15 @@ function get_memory_value {
|
||||||
printf "free_memory.value %.0f\n", $2
|
printf "free_memory.value %.0f\n", $2
|
||||||
}'
|
}'
|
||||||
done <<< "$data"
|
done <<< "$data"
|
||||||
|
<<<<<<< HEAD
|
||||||
# berechne used-memory
|
# berechne used-memory
|
||||||
# gesamt + frei = benutzt
|
# gesamt + frei = benutzt
|
||||||
printf "used_memory.value %.0f\n" "$(echo $mem_total $mem_free | awk '{print ($1 - $2)}')"
|
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 {
|
function get_disk_label {
|
||||||
|
@ -392,13 +397,13 @@ function get_disk_value {
|
||||||
done <<< "$data"
|
done <<< "$data"
|
||||||
}
|
}
|
||||||
|
|
||||||
# rufe funktionen auf, reihenfolge ist wichtig
|
# call functions, the order is important
|
||||||
get_data
|
get_data
|
||||||
validate_data
|
validate_data
|
||||||
get_name
|
get_name
|
||||||
get_cpu_count
|
get_cpu_count
|
||||||
# munin-Logik
|
# munin-Logic
|
||||||
# wenn $1 = X; dann
|
# id $1 = X; then
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
if ! command -v sshpass &> /dev/null; then
|
if ! command -v sshpass &> /dev/null; then
|
||||||
echo "[ERROR] sshpass could not be found!"
|
echo "[ERROR] sshpass could not be found!"
|
||||||
|
@ -408,8 +413,8 @@ if [ "$1" = "autoconf" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "config" ]; then
|
if [ "$1" = "config" ]; then
|
||||||
# gebe label aus
|
# print label
|
||||||
# wenn dirtyconfig gesetzt rufe value funktion auf
|
# if dirtyconfig is set print the value
|
||||||
get_voltage_label
|
get_voltage_label
|
||||||
if [ "$MUNIN_CAP_DIRTYCONFIG" = "1" ]; then
|
if [ "$MUNIN_CAP_DIRTYCONFIG" = "1" ]; then
|
||||||
get_voltage_value
|
get_voltage_value
|
||||||
|
@ -444,8 +449,7 @@ if [ "$1" = "config" ]; then
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# wird nie aufgerufen wenn dirtyconfig gesetzt ist
|
# does not get called if dirtyconfig is set
|
||||||
# dann wird nur config aufgerufen und dabei werden zusätzlich die values ausgegeben
|
|
||||||
get_voltage_value
|
get_voltage_value
|
||||||
get_bad_blocks_value
|
get_bad_blocks_value
|
||||||
get_write_sect_total_value
|
get_write_sect_total_value
|
||||||
|
@ -456,7 +460,7 @@ get_memory_value
|
||||||
get_disk_value
|
get_disk_value
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
# Beispieloutput ROS 6.4*
|
# Example Output ROS 6.4*
|
||||||
# voltage: 24.5V
|
# voltage: 24.5V
|
||||||
# cpu-temperature: 31C
|
# cpu-temperature: 31C
|
||||||
# uptime: 4w3d21h28m58s
|
# uptime: 4w3d21h28m58s
|
||||||
|
@ -482,7 +486,7 @@ exit 0
|
||||||
# 1 cpu1 19% 0% 0%
|
# 1 cpu1 19% 0% 0%
|
||||||
# name: crs309
|
# name: crs309
|
||||||
|
|
||||||
# Beispieloutput ROS 7*
|
# Example Output ROS 7*
|
||||||
# Columns: NAME, VALUE, TYPE
|
# Columns: NAME, VALUE, TYPE
|
||||||
# # NAME VA T
|
# # NAME VA T
|
||||||
# 0 cpu-temperature 44 C
|
# 0 cpu-temperature 44 C
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue