New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


SSH script advanced sensor for monitoring Nvidia GPU

Votes:

0

Your Vote:

Up

Down

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 by  ashkan (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.