-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose more hardware information #2
base: master
Are you sure you want to change the base?
Conversation
Also, I plan on making a Grafana dashboard to go with this plugin very soon. When I finish that I'll also add it to the repo! |
Wow. Thanks. Looks great. I will merge it soon. |
} | ||
|
||
var sensors []Sensor | ||
sensors, err = p.QuerySensors() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it does not work well.
Using configuration file:
[[inputs.open_hardware_monitor]]
HardwareType = ["GpuNvidia"] # optional
You are building sensor query using attribute "HardwareType" which is not available in Sensor query class:
It result with query error:
PS D:\Temp\ohm> .\open_hardware_monitor-telegraf-plugin.exe --config .\open_hardware_monitor-telegraf-plugin.config
2022/09/05 12:24:12 E! Error in plugin: Exception occurred. (Invalid query )
Analysing the source code, the wmi query looks like this:
Get-WmiObject -Namespace root/OpenHardwareMonitor -Query "SELECT * FROM SENSOR WHERE (HardwareType='GpuNvidia')"
which lead to an query error:
Get-WmiObject : Invalid query "SELECT * FROM SENSOR WHERE (HardwareType='GpuNvidia')"
At line:1 char:1
+ Get-WmiObject -Namespace root/OpenHardwareMonitor -Query "SELECT * FR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Sensor response for command:
Get-WmiObject -Namespace root/OpenHardwareMonitor -Query "SELECT * FROM SENSOR"
returns:
__GENUS : 2
__CLASS : Sensor
__SUPERCLASS :
__DYNASTY : Sensor
__RELPATH : Sensor.InstanceId="3911",ProcessId="67ccdffb-07e7-45fc-bdb6-f017483b0a9f"
__PROPERTY_COUNT : 10
__DERIVATION : {}
__SERVER : MARIANO-PC
__NAMESPACE : root\OpenHardwareMonitor
__PATH : \\MARIANO-PC\root\OpenHardwareMonitor:Sensor.InstanceId="3911",ProcessId="67ccdffb-07e7-45fc-bdb6-f017483b0a9f"
Identifier : /lpc/nct6798d/fan/1
Index : 1
InstanceId : 3911
Max : 1032.11
Min : 601.0685
Name : Fan #2
Parent : /lpc/nct6798d
ProcessId : 67ccdffb-07e7-45fc-bdb6-f017483b0a9f
SensorType : Fan
Value : 611.6901
PSComputerName : MARIANO-PC
So there is no "HardwareType" field.
@@ -0,0 +1,18 @@ | |||
[[inputs.open_hardware_monitor]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this sample configuration file in etc\open_hardware_monitor-telegraf-plugin.config
Makefile script automatically pack it into zip file while generating github release.
Hi @marianob85!
I have recently been building Grafana dashboards for my homelab, and was having trouble getting data from my Windows workstation. I came across your repo, and it worked great! However I was wanting some more information about the hardware, so I implemented it in my fork.
The changes include:
open_hardware_monitor
to match the input plugin name and module name_
,/
->_
)Hardware_
orSensor_
to distinguishName
,Identifier
, etcbuild-version.txt
to2.0.0
due to breaking changesI'm not sure how invested you are in this project, as it hasn't seen much activity for a while. I know that this PR introduces quite a few breaking changes, so I understand if you don't want to merge it. In that case, I'll just maintain my fork separately.
Let me know if you have any questions or suggested changes! 🚀