Introducing : Remote Sensor Monitor - A RESTful Web Server

I have the remote viewing server installed with nssm. i can go to the http/port of the server but i can't get hwinfo remote portion of the skin to work
[HWiNFORemoteHost0Name]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOHostId=#HWiNFO-RemoteHost0# IDK what to put here the ip/port? https://ip/port etc
HWiNFOSensorId=#HWiNFO-RemoteHost0-System-SensorId#
HWiNFOSensorInstance=#HWiNFO-RemoteHost0-System-SensorInstance#
HWiNFOType=SensorName
RegExpSubstitute=1
Substitute="\[(.*?)\].+$":"--- \1 ---"
UpdateDivider=30
 
nono the server is 100% working i see it in my browser on the other computer, that line is from the config for the rainmeter skin that you identify that host computer
 
If you are seeing a working server in your browser then have you tried using that IP and port (i.e. the server and port you are using when seeing in the browser)? I have not used Rainmeter myself yet so probably not the best person to give advice :)
 
1st of all - nice work(!!!), Martin, for HWiNFO and nice work, Ganesh, for the JSON server!

To state the stats of where I am, what I experience and where I want to go:
I'm running a fully watercooled rig w/ W10 Pro (1903) & the latest HWiNFO (incl. Rainmeter/RTSS) - all fine/stable.
My monitoring server, where I wish to 'trap' measurement values is a Zabbix 4 LTS (on deb stretch).
This is all pers./private fun - I also deal w/ a Zabbix SRV on a medium 4c RHEL w/ a generous Maria DB piggy backed (conc. comm > 400/s) in an enterprise environment, handling nearly 13k items and avg 160 processes/s - I know a tiny bit about ZBX - but that's another 'business' ;-)

Noticing that the generic ZBX template for Win monitoring (agentd/poller) is not precise about the CPU load vs the number of cores, but HWiNFO delivering clean and consistent details AND looking into eliminating the poller aspect (the ZBX agentd runs a high queue trying to reach a client host that is naturally turned off when not in use), I was/am looking into creating the measurement values at the point of origin and e.g. using the zabbix_sender.exe to push them into a ZBX Trapper on the server (zabbix_sender also uses JSON internally and is capable of bulk/blob btw).

That is how I came about to experiment w/ Ganesh's Remote Sensor Monitor...
Got it fired up (port def opt is a bit missleading but easily figured out ;-) ) and had JSON data available on the local net via HTTP.
On ZBX I the created a (parent) item using http_agent to grab the JSON as a string and take it from there w/ a child item - starting w/ the CPU load - SWEET, I got a precise graph going in ZBX!

1574760275503.png

Unfortunatelly I stumble into two issues - the first being the biggest caveat:
  1. When I apply a synth. 100% load (Prime95) on all 4 cores / 8 threads ([email protected] stable), within seconds ZBX reports an http 500 - and extending timeouts/delays past 3s does not help (local GB LAN).
    I haven't investigated details, but I assume both priority and instability issues - both, removing the synth. load as well as waiting a period of time, don't help - the JSON SRV needs a restart :-(

  2. Possibly I don't know a damn thing about JSON/ZBX, but I find it hard to have ZBX 'look into' the JSON data provided by the Rem Serv Mon...
    Manually cutting down the origin tree to just one value (using Rem Serv Mon Conf) made it easy to figure out the makings of a child item in ZBX - but 'normalising' the complete tree is s/t I hadn't figured out yet (or ZBX 4 LTS can't do it)...
    ?
Example of the tree as it is and what I presume to be more helpful:
[
{
"SensorApp": "HWiNFO",
"SensorClass": "System",
"SensorName": "Virtual Memory Commited",
"SensorValue": "10431",
"SensorUnit": "MB",
"SensorUpdateTime": 1574756119
},
...

[
"SensorApp": "HWiNFO"
{
"SensorClass": "System"
{
"SensorName": "Virtual Memory Commited",
"SensorValue": "10431",
"SensorUnit": "MB",
"SensorUpdateTime": 1574756119
},
...
}
...


Ganesh/ALL - w/ all do respect - am I thinking in the wrong direction?

My other thought (primary actually) goes into the direction of using the native onboard zabbix_sender.exe - but cherry-picking the few needed 5, 6, 7 values - thus further reducing the overwhelming amount of values available (266 items of "SensorApp": "HWiNFO" !) and therefore furthurly reducing process time/load...
...but how to access individual values from HWiNFO (shared mem access I presume - Martin, I had recently written you an email ;-) ) and scripting a simple BAT or PS1 to address the zabbix_sender.exe or to to have the zabbix_sender.exe run through a list of objects?

However I get it running, I'll be glad to share it!

THX for your ideas, thoughts & insights!
 
Hi ScoRe-Graffix,

If I understand your question correctly I might be able to help you.
You just need to query HWiNFO stats via http/https running on a Windows machine, Correct?

I am currently implementing a REST server which will allow you to specify which sensor to query etc and return the results in JSON. It's still in early BETA but you can currently use it to query all the HWiNFO stats as JSON without any performance/delay issues

Take a look at my project and see if it helps you in anyway. I could make changes if required or prioritise any functionality you need? Either way if you provide more info I should be able to help you out.

For more info see the dependent projects listed in the following page:-

P.S. The demo uses pre-recorded data with internet latency so is not a true representation of updates (which when running locally are now synced to the HWiNFO internal polling interval)
 
Last edited:
Hi Minty,

that looks quite interesting - & slick!

I have two possibilities to get data from a client host (PC) to my ZBX server (monitoring):
  1. ZBX Poller (mon server) push request -> ZBX agentd (host)
    Generate a JSON server on the PC w/ either all or selected values (would prefer only selected) to be then parsed by an http_agent on the ZBX server.
    Though this is an option, from enterprise environment experience it is NOT the prefered option, as the needed ZBX poller will run into timeouts (thus creating a queue) when the PC is not running.
    Each unanswered poller item generates a queue item - pollers are rather meant for 24/7 servers.

  2. zabbix_sender.exe (host) push -> ZBX Trapper (mon server)
    To feed the 'ZBX Trapper' w/ data I just call the EXE in a batch, followed by server address, hostname, key and value.
    This is pretty straight forward for single values.
    My goal is to do this w/ a list file, which for each value contains a line: <hostname> <key> <value>
    Internally the zabbix_sender.exe communicates a JSON string to the ZBX trapper listening for inbounds and the ZBX server takes care of writing in the values to the items for that host...
    Using the trapper on the ZBX server is more efficient because it will not queue easily and causes only minimal load if no values are sent (e.g. when a sending host is down, like my PC when I'm not using it).
The zabbix_sender.exe allows to use a file (and even a timestamp for each value if it were mission critical).
I would just run a simple for-to-next, to define the values in variables and then make the zabbix_sender.exe run through them...
I know using the zabbix_sender.exe to be more efficient/streamlined already than to write up s/t homebrew (from training and commercial use).

I've recently seen a prod. PowerShell script (simulating the zabbix_sender) being used on commercial Win servers - but I don't know yet how 'stable' this is - I would consider it though (nice on managed servers: have the ps1 registered as a scheduled task by your ITSP and place the config on a file share within the network -> scale or customise as needed w/o having to depend on your ITSP for costly mods).

So basically my need is to get the sensor values...
 
Hi ScoRe-Graffix,

So my project is basically 3 parts as follows:-

1) HTTP(S) Server - outputs realtime statistics via web sockets to a rendered html page (charts etc). It also has RESTful support so will eventually accept queries for specific sensor info.
2) JNI bridge to HWiNFO wrapper (Minty Sensor Monitor)
3) HWiNFO wrapper (reads the shared memory)

So it sounds like installing my complete server would be overkill as this is pretty much the part you want to run on your remote server. The server side has functionality such as recording history and sending alerts etc. which you don't seem to require.

Prior to using JNI for the monitor part I was simply using console System.IN <--> System.OUT to obtain all the sensor information as a JSON formatted string. You could use this to obtain all the sensor information from the PC and parse this or send as the complete packet. See following example of the JSON output. This would involve running a simple executable with a couple of dependencies (the source code is fully available apart from the HWiNFO part which is private in line with Martin's terms of usage).

You could basically kick off a call via script to obtain the sensor info MintySensorMonitor {'source':'MSM[JSON]HWiNFO','type':'info.mintymods.msm.MsmMonitorRequest','debug':false} and send the output to your zabbix_sender. You could use JQ to modify the JSON object as required to filter out any info you don't want.

Note: this is an old version prior to the JNI support and other functionality such as knowing when HWiiNFO is not running so it currently outputs the following when it cant communicate with HWiNFO

Code:
 ERROR MintyServiceHWiNFO.MsmServiceHWiNFO - System.IO.FileNotFoundException: Unable to find the specified file.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.MemoryMappedFiles.MemoryMappedFile.OpenCore(String mapName, HandleInheritability inheritability, Int32 desiredAccessRights, Boolean createOrOpen)

Which is a bit rubbish but I can update that if needed.

Does this give you what you need?

Minty

P.S. If you (or anyone) do download and test the executable I would be grateful if you could provide me with a sample output to allow me to investigate some features for the front end. e.g. how your hardware is described etc.

P.P.S. Do you know C#? If the full list of sensor results is a problem we could simply FORK the code and adjust to your requirements or implement a specific reponse type for Zabbix if there is such a format?
 
Last edited:
Hello,

Thank you for that plugin. Very good job ! Is there a way to launch it as a service at windows startup ? I cant deal with it... The goal is to not have a window always open for the server to run.
If anyone has an idea ?

Thank you in advance :)
 
Thanks ! Will have a look, didnt heard about those 2. I am not really familair with windows environment...
 
Great work, from what i can see the formatting of this json is not in a friendly way for Home Assistant to handle, is there any chance the output of the json could be changed. or the sourcecode provided so i could tweak it myself?
 
I have written my own logging with a PowerShell script that uses another program and shared memory, since there API is public. I'd like to migrate to use HWiNFO, since it proprietary I have to find another solution. This looks like a possible solution but not all of the data I would like is available from HWiNFO, I currently merge data from EventLog, nv-smi, WMI.

Do you think it's possible to modify this to add in additional information?

I did something else with rainmeter, I disabled the local logging, and use the sharing in HWinfo to merge all the data there and use the plugin to show the data.
 
Last edited:
I'm currently trying to use this plugin to make an arduino sensor readout thru a 7-segment display, so i can put inside my pc and easily look at the temperatures and such.

I'm a newbie when it comes to windows commands and such so I'm sorry if this is a trivial thing

Is there any way to make a permanent config file which makes the plugin only output certain values?

I change the http://<IP>:<PORT>/config page, but every time the server starts it resets to default. is there any way to make it permanent? I have limited memory in the chip so i don't want it to have to read all the sensors.

Any help would be appreciated
 
Hello.
Great work, works perfect! I collect info and send to my own statistic server. Additionally I would like to get minimum, maximum and average value from hwinfo. How I can get its?
 
Just updated to hwinfo to 6.26-4160 and now the sensor monitor is throwing this error at startup:

"An error occured while opening the HWiNFO shared memory! - Unable to find the specified file."

edit: i just needed to open the sensor window to get shared memory working. good now.
 
Last edited:
This tool seems to be no longer updated by the author and quite buggy. I'd suggest to move to something more advanced, reliable ../..

HWiNFO could really benefit some some kind of API that allows external access to its data. I'd love to see WMI or REST being built-in in a future version, without the need for external addons (that may or may not have various degrees of robustness). And I'm quite positive I'm not alone hoping for such a feature.

A good example is OpenHardwareMonitor/LibreHardwareMonitor (it uses WMI). It makes life so much easier for people that want 24/7 monitoring of their systems. Another example is HDSentinel, that has both WMI and REST.
 
Back
Top