2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

use variable names also in the configuration

This commit is contained in:
Nils 2018-02-22 13:14:19 +01:00
parent cf52a44380
commit 60a2093605

View File

@ -120,11 +120,11 @@ if [ "$1" = "config" ]; then
while [ "$nGpusCounter" -lt "$nGpus" ] while [ "$nGpusCounter" -lt "$nGpus" ]
do do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "temp${nGpusCounter}.warning ${warning:-75}" echo "${name}${nGpusCounter}.warning ${warning:-75}"
echo "temp${nGpusCounter}.critical ${critical:-95}" echo "${name}${nGpusCounter}.critical ${critical:-95}"
echo "temp${nGpusCounter}.info Temperature information for $gpuName" echo "${name}${nGpusCounter}.info Temperature information for $gpuName"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
done done
;; ;;
mem) mem)
# First determine total memory of each GPU... # First determine total memory of each GPU...
@ -134,7 +134,7 @@ if [ "$1" = "config" ]; then
while [ "$nGpusCounter" -lt "$nGpus" ] while [ "$nGpusCounter" -lt "$nGpus" ]
do do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "mem${nGpusCounter}.info Memory information for $gpuName" echo "${name}${nGpusCounter}.info Memory information for $gpuName"
gpuMem=$(echo "$gpusTotalMemOutput"| sed -n $((nGpusCounter+1))p) gpuMem=$(echo "$gpusTotalMemOutput"| sed -n $((nGpusCounter+1))p)
gpusTotalMem="${gpusTotalMem}${gpuMem} for GPU ${nGpusCounter}" gpusTotalMem="${gpusTotalMem}${gpuMem} for GPU ${nGpusCounter}"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
@ -159,9 +159,9 @@ if [ "$1" = "config" ]; then
while [ "$nGpusCounter" -lt "$nGpus" ] while [ "$nGpusCounter" -lt "$nGpus" ]
do do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "fan${nGpusCounter}.info Fan information for $gpuName" echo "${name}${nGpusCounter}.info Fan information for $gpuName"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
done done
;; ;;
power) power)
echo 'graph_title GPU power consumption' echo 'graph_title GPU power consumption'
@ -172,7 +172,7 @@ if [ "$1" = "config" ]; then
while [ "$nGpusCounter" -lt "$nGpus" ] while [ "$nGpusCounter" -lt "$nGpus" ]
do do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "power${nGpusCounter}.info power consumption of $gpuName" echo "${name}${nGpusCounter}.info power consumption of $gpuName"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
done done
;; ;;
@ -186,7 +186,7 @@ if [ "$1" = "config" ]; then
while [ "$nGpusCounter" -lt "$nGpus" ] while [ "$nGpusCounter" -lt "$nGpus" ]
do do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "utilization${nGpusCounter}.info GPU utilization information for $gpuName" echo "${name}${nGpusCounter}.info GPU utilization information for $gpuName"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
done done
;; ;;
@ -255,6 +255,3 @@ do
echo "${name}${nGpusCounter}.value $value" echo "${name}${nGpusCounter}.value $value"
: $((nGpusCounter=nGpusCounter+1)) : $((nGpusCounter=nGpusCounter+1))
done done