1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

nvidia_gpu_: add Rx/Tx throughput outputs

This commit is contained in:
Christian Neumann 2021-07-14 20:44:04 +02:00 committed by Lars Kruse
parent a542895c0f
commit 78aac0314b

View file

@ -87,6 +87,8 @@ if [ "$1" = "suggest" ]; then
echo "fan"
echo "power"
echo "utilization"
echo "rx"
echo "tx"
exit 0
fi
@ -190,6 +192,32 @@ if [ "$1" = "config" ]; then
: $((nGpusCounter=nGpusCounter+1))
done
;;
rx)
echo 'graph_title GPU Rx Throughput'
echo 'graph_vlabel Bits/sec'
echo 'graph_category system'
echo "graph_info Rx Throughput of NVIDIA GPUs using driver version $driverVersion"
nGpusCounter=0
while [ $nGpusCounter -lt "$nGpus" ]
do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "${name}${nGpusCounter}.info Rx Throughput of $gpuName"
: $((nGpusCounter=nGpusCounter+1))
done
;;
tx)
echo 'graph_title GPU Tx Throughput'
echo 'graph_vlabel Bits/sec'
echo 'graph_category system'
echo "graph_info Tx Throughput of NVIDIA GPUs using driver version $driverVersion"
nGpusCounter=0
while [ $nGpusCounter -lt "$nGpus" ]
do
gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1)
echo "${name}${nGpusCounter}.info Tx Throughput of $gpuName"
: $((nGpusCounter=nGpusCounter+1))
done
;;
*)
echo "Can't run without a proper symlink. Exiting."
echo "Try running munin-node-configure --suggest."
@ -239,6 +267,14 @@ case $name in
utilization)
valueGpus=$(echo "$smiOutput" | grep "Gpu" | cut -d ':' -f 2 | cut -d ' ' -f 2)
;;
rx)
valueGpus=$(echo "$smiOutput" | grep "Rx Throughput" | cut -d ':' -f 2 | cut -d ' ' -f 2)
valueGpus=$((valueGpus*1024))
;;
tx)
valueGpus=$(echo "$smiOutput" | grep "Tx Throughput" | cut -d ':' -f 2 | cut -d ' ' -f 2)
valueGpus=$((valueGpus*1024))
;;
*)
echo "Can't run without a proper symlink. Exiting."
echo "Try running munin-node-configure --suggest."