What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

SSH script advanced sensor for monitoring Nvidia GPU

Votes:

0

Hi all,

I made a SSH script advanced sensor for monitoring Nvidia GPU. Please let's make it better together:

https://gitlab.com/aschkaan/nvidia-gpu-monitor-prtg

#/bin/bash

#Performance State (P0:max-P12:min)

b1=$(nvidia-smi -q --display=PERFORMANCE | grep "Performance State" | cut -d ':' -f 1)

b2=$(nvidia-smi -q --display=PERFORMANCE | grep "Performance State" | cut -d ':' -f 2 | tr -dc '0-9')

#GPU Current Temp

c1=$(nvidia-smi -q -d temperature | grep "GPU Current Temp" | cut -d ':' -f 1)

c2=$(nvidia-smi -q -d temperature | grep "GPU Current Temp" | cut -d ':' -f 2 | tr -dc '0-9')

#GPU usage (%)

d1=$(nvidia-smi -q --display=UTILIZATION | grep Gpu | cut -d ':' -f 1)

d2=$(nvidia-smi -q --display=UTILIZATION | grep Gpu | cut -d ':' -f 2 | tr -dc '0-9')

#Memory usage (%)

e1=$(nvidia-smi -q --display=UTILIZATION | grep "Memory" | head -1 | cut -d ':' -f 1)

e2=$(nvidia-smi -q --display=UTILIZATION | grep "Memory" | head -1 | cut -d ':' -f 2 | tr -dc '0-9')

echo "<prtg>

        <result>

                <channel>$b1</channel>

                <value>$b2</value>

        </result>

        <result>

                <channel>$c1</channel>

                <value>$c2</value>

        </result>

        <result>

                <channel>$d1</channel>

                <value>$d2</value>

        </result>

        <result>

                <channel>$e1</channel>

                <value>$e2</value>

        </result>

</prtg>"

Thank you in advance.

Ashkan

bash-script gpu nvidia ssh-advanced-custom-script

Created on Oct 22, 2020 9:42:24 AM



1 Reply

Votes:

0

Hello,

Thank you for sharing your script with the community. Have a nice day.

Kind regards.

Created on Oct 23, 2020 6:09:44 AM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.