1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

quote $nvSmiExec and use for driverVersion

This commit is contained in:
Nils 2018-02-23 18:55:59 +01:00
parent 7ef2911ee1
commit cc0efe410b

View file

@ -91,7 +91,7 @@ if [ "$1" = "suggest" ]; then
fi fi
# Get number of GPUs # Get number of GPUs
nGpusOutput=$($nvSmiExec -L) nGpusOutput=$("$nvSmiExec" -L)
nGpus=$(echo "$nGpusOutput" | wc -l) nGpus=$(echo "$nGpusOutput" | wc -l)
if [ "$nGpus" -eq 0 ]; then if [ "$nGpus" -eq 0 ]; then
# Exit if no GPUs found # Exit if no GPUs found
@ -100,13 +100,13 @@ if [ "$nGpus" -eq 0 ]; then
fi fi
# Get full output from nvidia-smi # Get full output from nvidia-smi
smiOutput=$($nvSmiExec -q) smiOutput=$("$nvSmiExec" -q)
# Check if config was requested # Check if config was requested
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
# Get driver version # Get driver version
driverVersion=$(nvidia-smi -q | grep "Driver Version" | cut -d : -f 2 | tr -d ' ') driverVersion=$(echo "$smiOutput" | grep "Driver Version" | cut -d : -f 2 | tr -d ' ')
# Configure graph depending on what which quantity will be plotted # Configure graph depending on what which quantity will be plotted
case $name in case $name in