I'm looking for a plugin to check graphics card on hosts

Hi,
Is there any existing plugins to check graphic card on windows hosts. I checked exchange :: Icinga Exchange and couldn’t find any.

Thanks,
Shadi

Searching for nagios graphics card got me some:

https://exchange.icinga.com/jasem/check_nvidia
https://exchange.nagios.org/directory/Plugins/Hardware/Others/GPU-Sensor-Monitoring-Plugin/details

Hi @log1c ,
I picked check_nvidia from the link above. but now I get this message I’m not sure if I know what is causing it .
Command “C:\Program Files\ICINGA2/sbin/check_nrpe” -H xxx.xxx.xxx.xxx -c check_nvidia failed to execute: 2, “The system cannot find the file specified.”

Shadi

As I don’t know anything about your setup I just can assume:

check_nrpe is a script that runs on a linux system (e.g a master or satellite).
The path points to a windows systems.

So I assume the windows system has the Icinga agent installed, correct?
check_nrpe needs the NSClient to be installed on the system. Is that installed as well?
If yes, simply configure the check to run on the parent host (master or satellite) instead of the agent host. Just remove the command_endpoint setting from the service config, in Director speech that is “Run on Agent” = “No”

Hi,
My maste is on linux and I want to check graphic card on windows agent host. Yes Icinga and NSClient++ are installed on windows agent host. I made the change to

‘/usr/lib/nagios/plugins/check_nrpe’ ‘-H’ ‘xxx.xxx.xxx.xxx’ ‘-c’ ‘check_nvidia’ is the executed command now but it throw this error now

CHECK_NRPE: Error - Could not connect to ‘xxx.xxx.xxx.xxx’.

Seems like the NSClient is not configured correctly to accept the connection from the master.

Either configure the NSclient or use the Icinga Agent to run the PowerShell script.

Here is a small how to on configuring a PowerShell check command that can be used to run on the Agent:

HI,
Here is the powershell scrip which I modified a bit. it’s working when I am remotely connected to the host as soon as I log out from RDP. script returns empty values.

Here is the ps1 script

$computer = $env:COMPUTERNAME
$namespace = "ROOT\cimv2\NV"
$gpuclass = "Gpu"
$tempclass = "ThermalProbe"

$GPU_Meters=Get-WmiObject -Class $gpuclass -ComputerName $computer -Namespace $namespace | Select-Object *
$TEMP_Meters=Get-WmiObject -Class $tempclass -ComputerName $computer -Namespace $namespace | Select-Object *

$gpu_usage=$GPU_Meters.percentGpuUsage
$mem_usage=$GPU_Meters.percentGpuMemoryUsage
$temperature=$TEMP_Meters.temperature

$diverversion =  Get-WmiObject Win32_PnPSignedDriver| select devicename, driverversion | where {$_.devicename -like "*$nvidia_model*"} 

$output = "Nvidia $nvidia_model Memory:$mem_usage% Driver:$diverversion GPU:$gpu_usage% Temp:$Temperature°C | Memory=$mem_usage;;;0; GPU=$gpu_usage;;;0; TEMP=$temperature;;;0;"

Write-Host $Output

exit 0

here is the output on server when I’m logged in through Remote Desktop Connection
@{devicename=NVIDIA Quadro P2000; driverversion=26.21.14.3170} Memory:3% GPU:0% Temp:°C

which is close to what I needed. when I log out of RDP the result changes on next check to
Memory:% GPU:% Temp:°C

I guess you are running the script with admin privileges when logged in, and the NSclient is running as a network (or system) service.
option 1: check how to configure wmi for non-administrative users
option 2: give elevated rights to the nsclient service, maybe running it as nt authority/system will do, maybe you need to configure an admin user (not recommended)

also the changes you made to your script can cause trouble, because you are printing a powershell object in the output, instead of strings.
replace $nvidia_model with the correct property values of the object.
Back to Basics: Understanding PowerShell Objects