{"id":22951555,"url":"https://github.com/lifailon/powershell.hardwaremonitor","last_synced_at":"2025-08-13T00:32:46.829Z","repository":{"id":202616911,"uuid":"707660083","full_name":"Lifailon/PowerShell.HardwareMonitor","owner":"Lifailon","description":"Module for local and remote data acquisition temperature, load and other sensors system, for implement monitoring via InfluxDB and Grafana","archived":false,"fork":false,"pushed_at":"2024-02-15T12:29:45.000Z","size":7279,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"rsa","last_synced_at":"2024-12-03T16:46:33.597Z","etag":null,"topics":["api","cim","grafana","grafana-dashboard","hardware","influxdb","monitor","monitoring","ohm","openhardware","openhardwaremonitor","powershell","rest","rest-api","sensor","sensors","temperature-monitoring","temperature-sensor","windows","wmi"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/HardwareMonitor","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lifailon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-20T11:32:34.000Z","updated_at":"2024-05-19T17:43:20.000Z","dependencies_parsed_at":"2023-10-20T16:32:40.818Z","dependency_job_id":"342e3826-ab5d-441e-abc3-638a6c53e632","html_url":"https://github.com/Lifailon/PowerShell.HardwareMonitor","commit_stats":{"total_commits":60,"total_committers":2,"mean_commits":30.0,"dds":0.4,"last_synced_commit":"78344b157ec69d3f9f086e5f185c620f4ddc7133"},"previous_names":["lifailon/sensorstoinfluxdb","lifailon/powershellhardwaremonitor","lifailon/powershell.hardwaremonitor"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lifailon%2FPowerShell.HardwareMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lifailon%2FPowerShell.HardwareMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lifailon%2FPowerShell.HardwareMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lifailon%2FPowerShell.HardwareMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lifailon","download_url":"https://codeload.github.com/Lifailon/PowerShell.HardwareMonitor/tar.gz/refs/heads/rsa","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229717731,"owners_count":18113400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cim","grafana","grafana-dashboard","hardware","influxdb","monitor","monitoring","ohm","openhardware","openhardwaremonitor","powershell","rest","rest-api","sensor","sensors","temperature-monitoring","temperature-sensor","windows","wmi"],"created_at":"2024-12-14T15:16:41.631Z","updated_at":"2024-12-14T15:16:42.231Z","avatar_url":"https://github.com/Lifailon.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell.HardwareMonitor\n\n[![GitHub Tag](https://img.shields.io/github/v/tag/Lifailon/PowerShell.HardwareMonitor?logo=GitHub\u0026label=GitHub\u0026link=https%3A%2F%2Fgithub.com%2FLifailon%2FPowerShell.HardwareMonitor)](https://github.com/Lifailon/PowerShell.HardwareMonitor)\n[![NuGet Version](https://img.shields.io/nuget/v/HardwareMonitor?logo=NuGet\u0026label=NuGet\u0026link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FHardwareMonitor)](https://www.nuget.org/packages/HardwareMonitor)\n[![GitHub top language](https://img.shields.io/github/languages/top/Lifailon/PowerShell.HardwareMonitor?logo=PowerShell\u0026link=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell)](https://github.com/PowerShell/PowerShell)\n\nPublication on **Habr** (ru language): [Мониторинг температуры Windows. Создание метрик, настройка InfluxDB и Grafana](https://habr.com/ru/articles/793296/)\n\nModule for local and remote data acquisition temperature, fan speeds, load and other sensors system via [LibreHardwareMonitor](https://github.com/LibreHardwareMonitor/LibreHardwareMonitor) and [OpenHardwareMonitor](https://github.com/openhardwaremonitor/openhardwaremonitor) to output PowerShell console.\n\nThis module implements an out-of-the-box and universal solution for configuring temperature sensor monitoring with **InfluxDB v1.x** and visualization in **Grafana**.\n\n🔗 Implemented methods to get information:\n\n- ✅ REST API\n- ✅ WMI/CIM\n- ✅ Library .NET (incomplete)\n\n📌 Notes:\n\n- [🚀 Install](#-install)\n- [📑 Data](#-data)\n- [📊 InfluxDB connection](#-influxdb-connection)\n- [🔔 Creat service](#-creat-service)\n- [📈 Grafana dashboard](#-grafana-dashboard)\n\n## 🚀 Install\n\n### 📥 Module\n\nInstall module from [NuGet repository](https://www.nuget.org/packages/HardwareMonitor):\n\n```PowerShell\nInstall-Module HardwareMonitor -Repository NuGet -Scope AllUsers\n```\n\n\u003e Use the installation for all users (parameter `Scoop`) to avoid importing the module during script configuration to send data to the database during service creation.\n\n💡 You must have a NuGet repository registered:\n\n```PowerShell\nRegister-PSRepository -Name \"NuGet\" -SourceLocation \"https://www.nuget.org/api/v2\" -InstallationPolicy Trusted\n```\n\nImport the module and get a list of available commands:\n\n```PowerShell\nImport-Module HardwareMonitor\nGet-Command -Module HardwareMonitor\n\nCommandType     Name                               Version    Source\n-----------     ----                               -------    ------\nFunction        Get-Sensor                         0.4        HardwareMonitor\nFunction        Install-LibreHardwareMonitor       0.4        HardwareMonitor\nFunction        Install-OpenHardwareMonitor        0.4        HardwareMonitor\nFunction        Send-SensorToInfluxDB              0.4        HardwareMonitor\n```\n\n### 💡 Dependencies\n\nYou need to set one of the two data retrieval sources. You can use the functions built into the module to set them (default installation path `C:\\Users\\\u003cUserName\u003e\\Documents`):\n\n```PowerShell\nInstall-LibreHardwareMonitor\nInstall-OpenHardwareMonitor\n```\n\n## 📑 Data\n\nDifference in the amount of unique (non-empty) data, using the **HUAWEI MateBook X Pro** laptop as an example.\n\n### REST API via OpenHardwareMonitor\n\nThe software can act as an agent for data from which it can be collected remotely.\n\n```PowerShell\n\u003e Get-Sensor -ComputerName 192.168.3.99 -Port 8086 | Format-Table\n\nHardwareName                 SensorName SensorType       Value   Min     Max\n------------                 ---------- ----------       -----   ---     ---\n12th Gen Intel Core i7-1260P Load       CPU Total        7,3 %   2,0 %   17,2 %\n12th Gen Intel Core i7-1260P Load       CPU Core #1      11,7 %  0,0 %   50,0 %\n12th Gen Intel Core i7-1260P Load       CPU Core #2      0,0 %   0,0 %   27,3 %\n12th Gen Intel Core i7-1260P Load       CPU Core #3      0,0 %   0,0 %   18,0 %\n12th Gen Intel Core i7-1260P Load       CPU Core #4      0,0 %   0,0 %   4,8 %\n12th Gen Intel Core i7-1260P Load       CPU Core #5      10,9 %  0,0 %   28,1 %\n12th Gen Intel Core i7-1260P Load       CPU Core #6      7,8 %   0,0 %   45,3 %\n12th Gen Intel Core i7-1260P Load       CPU Core #7      9,4 %   0,0 %   51,6 %\n12th Gen Intel Core i7-1260P Load       CPU Core #8      18,8 %  0,0 %   46,9 %\n12th Gen Intel Core i7-1260P Load       CPU Core #9      9,4 %   0,0 %   18,8 %\n12th Gen Intel Core i7-1260P Load       CPU Core #10     4,7 %   0,0 %   23,4 %\n12th Gen Intel Core i7-1260P Load       CPU Core #11     21,9 %  0,0 %   34,4 %\n12th Gen Intel Core i7-1260P Load       CPU Core #12     10,9 %  0,0 %   26,6 %\nGeneric Memory               Load       Memory           75,3 %  73,5 %  76,3 %\nGeneric Memory               Data       Used Memory      11,8 GB 11,6 GB 12,0 GB\nGeneric Memory               Data       Available Memory 3,9 GB  3,7 GB  4,2 GB\n```\n\n### REST API via LibreHardwareMonitor\n\nYou can also **use authorization** (if it is configured on the LibreHardwareMonitor side):\n\n```PowerShell\n\u003e Get-Sensor -ComputerName 192.168.3.99 -Port 8085\nInvoke-RestMethod: Response status code does not indicate success: 401 (Unauthorized).\n\u003e Get-Sensor -ComputerName 192.168.3.99 -Port 8085 -User hardware -Password monitor | Where-Object Value -notmatch \"^0,0\" | Format-Table\n\nHardwareName                     SensorName                     SensorType      Value   Min       Max\n------------                     ----------                     ----------      -----   ---       ---\n12th Gen Intel Core i7-1260P     Bus Speed                      Clock 0           100   100       100\n12th Gen Intel Core i7-1260P     CPU Core #1                    Clock 1          4593   399      4693\n12th Gen Intel Core i7-1260P     CPU Core #10                   Clock 10          998   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #11                   Clock 11         1997   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #12                   Clock 12          998   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #2                    Clock 2          2396   399      4693\n12th Gen Intel Core i7-1260P     CPU Core #3                    Clock 3          2097   399      4693\n12th Gen Intel Core i7-1260P     CPU Core #4                    Clock 4          1498   399      4693\n12th Gen Intel Core i7-1260P     CPU Core #5                    Clock 5          1098   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #6                    Clock 6          1098   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #7                    Clock 7          1198   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #8                    Clock 8          1098   399      3395\n12th Gen Intel Core i7-1260P     CPU Core #9                    Clock 9          1198   399      3395\n12th Gen Intel Core i7-1260P     CPU Total                      Load 0              7     0        96\n12th Gen Intel Core i7-1260P     CPU Core Max                   Load 1             20     1       100\n12th Gen Intel Core i7-1260P     CPU Core #5                    Load 10            12     0       100\n12th Gen Intel Core i7-1260P     CPU Core #6                    Load 11            10     0       100\n12th Gen Intel Core i7-1260P     CPU Core #7                    Load 12             9     0       100\n12th Gen Intel Core i7-1260P     CPU Core #8                    Load 13            11     0       100\n12th Gen Intel Core i7-1260P     CPU Core #9                    Load 14            11     0       100\n12th Gen Intel Core i7-1260P     CPU Core #10                   Load 15             8     0       100\n12th Gen Intel Core i7-1260P     CPU Core #11                   Load 16             9     0       100\n12th Gen Intel Core i7-1260P     CPU Core #12                   Load 17             9     0       100\n12th Gen Intel Core i7-1260P     CPU Core #1 Thread #1          Load 2             20     0       100\n12th Gen Intel Core i7-1260P     CPU Core #1 Thread #2          Load 3              0     0        94\n12th Gen Intel Core i7-1260P     CPU Core #2 Thread #1          Load 4              7     0        95\n12th Gen Intel Core i7-1260P     CPU Core #2 Thread #2          Load 5              0     0        97\n12th Gen Intel Core i7-1260P     CPU Core #3 Thread #1          Load 6              5     0        99\n12th Gen Intel Core i7-1260P     CPU Core #3 Thread #2          Load 7              0     0        97\n12th Gen Intel Core i7-1260P     CPU Core #4 Thread #1          Load 8              6     0        95\n12th Gen Intel Core i7-1260P     CPU Core #4 Thread #2          Load 9              0     0        97\n12th Gen Intel Core i7-1260P     CPU Package                    Power 0            10     0        58\n12th Gen Intel Core i7-1260P     CPU Cores                      Power 1             5     0        51\n12th Gen Intel Core i7-1260P     CPU Memory                     Power 3             0     0         0\n12th Gen Intel Core i7-1260P     CPU Core #1                    Temperature 0      47    23        98\n12th Gen Intel Core i7-1260P     CPU Core #2                    Temperature 1      50    28        97\n12th Gen Intel Core i7-1260P     CPU Core #11                   Temperature 10     47    23        85\n12th Gen Intel Core i7-1260P     CPU Core #12                   Temperature 11     47    23        85\n12th Gen Intel Core i7-1260P     CPU Package                    Temperature 12     57    30        98\n12th Gen Intel Core i7-1260P     CPU Core #1 Distance to TjMax  Temperature 13     53     2        77\n12th Gen Intel Core i7-1260P     CPU Core #2 Distance to TjMax  Temperature 14     50     3        72\n12th Gen Intel Core i7-1260P     CPU Core #3 Distance to TjMax  Temperature 15     50     6        75\n12th Gen Intel Core i7-1260P     CPU Core #4 Distance to TjMax  Temperature 16     51     4        75\n12th Gen Intel Core i7-1260P     CPU Core #5 Distance to TjMax  Temperature 17     49    11        70\n12th Gen Intel Core i7-1260P     CPU Core #6 Distance to TjMax  Temperature 18     43    11        70\n12th Gen Intel Core i7-1260P     CPU Core #7 Distance to TjMax  Temperature 19     43    11        70\n12th Gen Intel Core i7-1260P     CPU Core #3                    Temperature 2      50    25        94\n12th Gen Intel Core i7-1260P     CPU Core #8 Distance to TjMax  Temperature 20     43    11        70\n12th Gen Intel Core i7-1260P     CPU Core #9 Distance to TjMax  Temperature 21     53    15        77\n12th Gen Intel Core i7-1260P     CPU Core #10 Distance to TjMax Temperature 22     53    15        77\n12th Gen Intel Core i7-1260P     CPU Core #11 Distance to TjMax Temperature 23     53    15        77\n12th Gen Intel Core i7-1260P     CPU Core #12 Distance to TjMax Temperature 24     53    15        77\n12th Gen Intel Core i7-1260P     Core Max                       Temperature 25     57    30        98\n12th Gen Intel Core i7-1260P     Core Average                   Temperature 26     50    27        86\n12th Gen Intel Core i7-1260P     CPU Core #4                    Temperature 3      49    25        96\n12th Gen Intel Core i7-1260P     CPU Core #5                    Temperature 4      51    30        89\n12th Gen Intel Core i7-1260P     CPU Core #6                    Temperature 5      57    30        89\n12th Gen Intel Core i7-1260P     CPU Core #7                    Temperature 6      57    30        89\n12th Gen Intel Core i7-1260P     CPU Core #8                    Temperature 7      57    30        89\n12th Gen Intel Core i7-1260P     CPU Core #9                    Temperature 8      47    23        85\n12th Gen Intel Core i7-1260P     CPU Core #10                   Temperature 9      47    23        85\n12th Gen Intel Core i7-1260P     CPU Core                       Voltage 0           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #1                    Voltage 1           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #10                   Voltage 10          1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #11                   Voltage 11          1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #12                   Voltage 12          1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #2                    Voltage 2           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #3                    Voltage 3           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #4                    Voltage 4           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #5                    Voltage 5           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #6                    Voltage 6           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #7                    Voltage 7           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #8                    Voltage 8           1     1         1\n12th Gen Intel Core i7-1260P     CPU Core #9                    Voltage 9           1     1         1\nБеспроводная сеть                Data Uploaded                  Data 2              0     0         0\nБеспроводная сеть                Data Downloaded                Data 3              6     0         6\nБеспроводная сеть                Network Utilization            Load 1              0     0        51\nБеспроводная сеть                Upload Speed                   Throughput 7     2687     0   1944587\nБеспроводная сеть                Download Speed                 Throughput 8   143893     0  44829424\nПодключение по локальной сети    Data Uploaded                  Data 2              0     0         0\nПодключение по локальной сети    Data Downloaded                Data 3              0     0         0\nПодключение по локальной сети    Network Utilization            Load 1              0     0         0\nПодключение по локальной сети    Upload Speed                   Throughput 7        0     0         0\nПодключение по локальной сети    Download Speed                 Throughput 8        0     0         0\nПодключение по локальной сети* 9 Data Uploaded                  Data 2              0     0         0\nПодключение по локальной сети* 9 Data Downloaded                Data 3              0     0         0\nПодключение по локальной сети* 9 Network Utilization            Load 1              0     0         0\nПодключение по локальной сети* 9 Upload Speed                   Throughput 7        0     0         0\nПодключение по локальной сети* 9 Download Speed                 Throughput 8        0     0         0\nСетевое подключение Bluetooth    Data Uploaded                  Data 2              0     0         0\nСетевое подключение Bluetooth    Data Downloaded                Data 3              0     0         0\nСетевое подключение Bluetooth    Network Utilization            Load 1              0     0         0\nСетевое подключение Bluetooth    Upload Speed                   Throughput 7        0     0         0\nСетевое подключение Bluetooth    Download Speed                 Throughput 8        0     0         0\nGeneric Memory                   Memory Used                    Data 0             12     7        12\nGeneric Memory                   Memory Available               Data 1              4     3         8\nGeneric Memory                   Virtual Memory Used            Data 2             16    11        17\nGeneric Memory                   Virtual Memory Available       Data 3             46    45        51\nGeneric Memory                   Memory                         Load 0             74    47        79\nGeneric Memory                   Virtual Memory                 Load 1             26    18        28\nHB5781P1EEW-31T                  Charge Current                 Current 2           1     0         3\nHB5781P1EEW-31T                  Designed Capacity              Energy 3        59424 59424     59424\nHB5781P1EEW-31T                  Full Charged Capacity          Energy 4        52587 52587     52587\nHB5781P1EEW-31T                  Remaining Capacity             Energy 5        52587 42400     52587\nHB5781P1EEW-31T                  Charge Level                   Level 0           100    81       100\nHB5781P1EEW-31T                  Degradation Level              Level 0            12    12        12\nHB5781P1EEW-31T                  Charge Rate                    Power 0             7     6        39\nHB5781P1EEW-31T                  Voltage                        Voltage 1          13    13        13\nHotspotShield Network Adapter    Data Uploaded                  Data 2              0     0         0\nHotspotShield Network Adapter    Data Downloaded                Data 3              0     0         0\nHotspotShield Network Adapter    Network Utilization            Load 1              0     0         0\nHotspotShield Network Adapter    Upload Speed                   Throughput 7        0     0         0\nHotspotShield Network Adapter    Download Speed                 Throughput 8        0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D 3D                         Load 0              8     0       100\nIntel(R) Iris(R) Xe Graphics     D3D Copy                       Load 1              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Video Decode               Load 10             0     0        23\nIntel(R) Iris(R) Xe Graphics     D3D Video Processing           Load 11             0     0        15\nIntel(R) Iris(R) Xe Graphics     D3D Video Processing           Load 12             0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D GDI Render                 Load 2              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 3              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 4              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 5              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 6              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 7              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Other                      Load 8              0     0         0\nIntel(R) Iris(R) Xe Graphics     D3D Video Decode               Load 9              0     0        51\nIntel(R) Iris(R) Xe Graphics     GPU Power                      Power 0             0     0       190\nIntel(R) Iris(R) Xe Graphics     D3D Shared Memory Used         SmallData 0      2726  1080      3226\nProtonVPN TUN                    Data Uploaded                  Data 2              0     0         0\nProtonVPN TUN                    Data Downloaded                Data 3              0     0         0\nProtonVPN TUN                    Network Utilization            Load 1              0     0         0\nProtonVPN TUN                    Upload Speed                   Throughput 7        0     0         0\nProtonVPN TUN                    Download Speed                 Throughput 8        0     0         0\nRadmin VPN                       Data Uploaded                  Data 2              0     0         0\nRadmin VPN                       Data Downloaded                Data 3              0     0         0\nRadmin VPN                       Network Utilization            Load 1              0     0         0\nRadmin VPN                       Upload Speed                   Throughput 7      211     0      5032\nRadmin VPN                       Download Speed                 Throughput 8        0     0        62\nvEthernet (Default Switch)       Data Uploaded                  Data 2              0     0         0\nvEthernet (Default Switch)       Data Downloaded                Data 3              0     0         0\nvEthernet (Default Switch)       Network Utilization            Load 1              0     0         0\nvEthernet (Default Switch)       Upload Speed                   Throughput 7      211     0      4900\nvEthernet (Default Switch)       Download Speed                 Throughput 8        0     0         0\nWD PC SN740 SDDPNQD-1T00-1027    Data Read                      Data 4          10761     0     10761\nWD PC SN740 SDDPNQD-1T00-1027    Data Written                   Data 5          10962     0     10962\nWD PC SN740 SDDPNQD-1T00-1027    Available Spare                Level 1           100     0       100\nWD PC SN740 SDDPNQD-1T00-1027    Available Spare Threshold      Level 2            10     0        10\nWD PC SN740 SDDPNQD-1T00-1027    Percentage Used                Level 3             0     0         0\nWD PC SN740 SDDPNQD-1T00-1027    Used Space                     Load 0             52    52        53\nWD PC SN740 SDDPNQD-1T00-1027    Read Activity                  Load 31             0     0       100\nWD PC SN740 SDDPNQD-1T00-1027    Write Activity                 Load 32             2     0       100\nWD PC SN740 SDDPNQD-1T00-1027    Total Activity                 Load 33             2     0       100\nWD PC SN740 SDDPNQD-1T00-1027    Temperature                    Temperature 0      48     0        66\nWD PC SN740 SDDPNQD-1T00-1027    Temperature 1                  Temperature 6      58     0        87\nWD PC SN740 SDDPNQD-1T00-1027    Temperature 2                  Temperature 7      48     0        66\nWD PC SN740 SDDPNQD-1T00-1027    Read Rate                      Throughput 34  180039     0 476410144\nWD PC SN740 SDDPNQD-1T00-1027    Write Rate                     Throughput 35  311204     0 693865152\n```\n\n### WMI (Windows Management Instrumentation)\n\nThe computer used is an **Intel Core i5 10400 based computer** to example. Filter the data to get temperature data only.\n\n```PowerShell\n\u003e Get-Sensor | Where-Object {($_.SensorName -match \"Temperature\") -or ($_.SensorType -match \"Temperature\")} | Format-Table\n\nHardwareName           SensorName                    SensorType     Value Min Max\n------------           ----------                    ----------     ----- --- ---\nIntel Core i5-10400    CPU Core #1                   Temperature 0     29  26  48\nIntel Core i5-10400    CPU Core #2                   Temperature 1     30  27  48\nIntel Core i5-10400    CPU Core #4 Distance to TjMax Temperature 10    73  57  75\nIntel Core i5-10400    CPU Core #5 Distance to TjMax Temperature 11    72  52  74\nIntel Core i5-10400    CPU Core #6 Distance to TjMax Temperature 12    70  51  73\nIntel Core i5-10400    Core Max                      Temperature 13    30  28  49\nIntel Core i5-10400    Core Average                  Temperature 14    29  27  40\nIntel Core i5-10400    CPU Core #3                   Temperature 2     28  26  47\nIntel Core i5-10400    CPU Core #4                   Temperature 3     27  25  43\nIntel Core i5-10400    CPU Core #5                   Temperature 4     28  26  48\nIntel Core i5-10400    CPU Core #6                   Temperature 5     30  27  49\nIntel Core i5-10400    CPU Package                   Temperature 6     30  29  49\nIntel Core i5-10400    CPU Core #1 Distance to TjMax Temperature 7     71  52  74\nIntel Core i5-10400    CPU Core #2 Distance to TjMax Temperature 8     70  52  73\nIntel Core i5-10400    CPU Core #3 Distance to TjMax Temperature 9     72  53  74\nMSI M390 250GB         Temperature                   Temperature 0     40   0  42\nNuvoton NCT6687D       CPU                           Temperature 0     36  29  47\nNuvoton NCT6687D       System                        Temperature 1     34  34  37\nNuvoton NCT6687D       VRM MOS                       Temperature 2     40  39  42\nNuvoton NCT6687D       PCH                           Temperature 3     40  38  44\nNuvoton NCT6687D       CPU Socket                    Temperature 4     32  32  34\nNuvoton NCT6687D       PCIe x1                       Temperature 5     29  29  29\nNuvoton NCT6687D       M2_1                          Temperature 6     23  23  23\nRadeon RX 570 Series   GPU Core                      Temperature 0     40  39  42\nST1000DM003-1CH162     Temperature                   Temperature 0     33  33  35\nWDC WD2005FBYZ-01YCBB2 Temperature                   Temperature 0     36  36  36\n```\n\n### Library .NET\n\n💡 To get data from all sensors, you need to run the console with **administrator privileges**.\n\n💡 Response speed through WMI is on average 5 times faster (200 milliseconds vs. 1 second to .NET Library) because a running instance of the application is used to retrieve the data, which also stores the minimum and maximum values.\n\n💡 On all systems tested, I was able to collect CPU and some disk data. In connection with this problem I have created a [request](https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/issues/1260) in the GitHub repository of LibreHardwareMonitor developers. For OpenHardwareMonitor, I have not been able to get the data.\n\n```PowerShell\n\u003e Get-Sensor -Library | Where-Object Value -ne 0 | Format-Table\n\nHardwareName         SensorName                    SensorType     Value  Min  Max\n------------         ----------                    ----------     -----  ---  ---\nIntel Core i5-10400  Bus Speed                     Clock 0          100  100  100\nIntel Core i5-10400  CPU Core #1                   Clock 1         4006 4006 4006\nIntel Core i5-10400  CPU Core #2                   Clock 2         4006 4006 4006\nIntel Core i5-10400  CPU Core #3                   Clock 3         4006 4006 4006\nIntel Core i5-10400  CPU Core #4                   Clock 4         4006 4006 4006\nIntel Core i5-10400  CPU Core #5                   Clock 5         4006 4006 4006\nIntel Core i5-10400  CPU Core #6                   Clock 6         4006 4006 4006\nIntel Core i5-10400  CPU Package                   Power 0           20   20   20\nIntel Core i5-10400  CPU Cores                     Power 1           13   13   13\nIntel Core i5-10400  CPU Memory                    Power 3            1    1    1\nIntel Core i5-10400  CPU Core #1                   Temperature 0     34   34   34\nIntel Core i5-10400  CPU Core #2                   Temperature 1     35   35   35\nIntel Core i5-10400  CPU Core #4 Distance to TjMax Temperature 10    74   74   74\nIntel Core i5-10400  CPU Core #5 Distance to TjMax Temperature 11    74   74   74\nIntel Core i5-10400  CPU Core #6 Distance to TjMax Temperature 12    74   74   74\nIntel Core i5-10400  Core Max                      Temperature 13    35   35   35\nIntel Core i5-10400  Core Average                  Temperature 14    29   29   29\nIntel Core i5-10400  CPU Core #3                   Temperature 2     26   26   26\nIntel Core i5-10400  CPU Core #4                   Temperature 3     26   26   26\nIntel Core i5-10400  CPU Core #5                   Temperature 4     26   26   26\nIntel Core i5-10400  CPU Core #6                   Temperature 5     26   26   26\nIntel Core i5-10400  CPU Package                   Temperature 6     35   35   35\nIntel Core i5-10400  CPU Core #1 Distance to TjMax Temperature 7     66   66   66\nIntel Core i5-10400  CPU Core #2 Distance to TjMax Temperature 8     65   65   65\nIntel Core i5-10400  CPU Core #3 Distance to TjMax Temperature 9     74   74   74\nIntel Core i5-10400  CPU Core                      Voltage 0          1    1    1\nIntel Core i5-10400  CPU Core #1                   Voltage 1          1    1    1\nIntel Core i5-10400  CPU Core #2                   Voltage 2          1    1    1\nIntel Core i5-10400  CPU Core #3                   Voltage 3          1    1    1\nIntel Core i5-10400  CPU Core #4                   Voltage 4          1    1    1\nIntel Core i5-10400  CPU Core #5                   Voltage 5          1    1    1\nIntel Core i5-10400  CPU Core #6                   Voltage 6          1    1    1\nRadeon RX 570 Series GPU Core                      Clock 0          300  300  300\nRadeon RX 570 Series GPU Memory                    Clock 2          300  300  300\nRadeon RX 570 Series Fullscreen FPS                Factor 0          -1   -1   -1\nRadeon RX 570 Series GPU Package                   Power 3           10   10   10\nRadeon RX 570 Series D3D Dedicated Memory Used     SmallData 0      504  504  504\nRadeon RX 570 Series D3D Shared Memory Used        SmallData 1       20   20   20\nRadeon RX 570 Series GPU Core                      Temperature 0     37   37   37\nRadeon RX 570 Series GPU Core                      Voltage 0          1    1    1\n```\n\n## 📊 InfluxDB connection\n\nProcess configuring **temperature sensor monitoring**.\n\n- Install [InfluxDB](https://www.influxdata.com/downloads) version 1.x\n\nDefine the server on which the time series database will be installed. It can be Windows, Linux (WSL or a virtual machine) or use [Docker image](https://hub.docker.com/_/influxdb).\n\nInstall to Windows:\n\n```PowerShell\nInvoke-RestMethod \"https://dl.influxdata.com/influxdb/releases/influxdb-1.8.10_windows_amd64.zip\" -OutFile \"$home\\Downloads\\influxdb-1.8.10_windows_amd64.zip\"\nExpand-Archive \"$home\\Downloads\\influxdb-1.8.10_windows_amd64.zip\" -DestinationPath \"$home\\Downloads\\\"\nRemove-Item \"$home\\Downloads\\influxdb-1.8.10_windows_amd64.zip\"\n\u0026 \"$home\\Downloads\\influxdb-1.8.10-1\\influxd.exe\"\n```\n\nExample for Ubuntu:\n\n```Bash\nwget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.10_amd64.deb\nsudo dpkg -i influxdb_1.8.10_amd64.deb\nsystemctl start influxdb\nsystemctl status influxdb\n```\n\n- Create database using [InfluxDB Studio](https://github.com/CymaticLabs/InfluxDBStudio) or [psinfluxdb](https://github.com/Lifailon/psinfluxdb) module\n\n```PowerShell\nInstall-Module psinfluxdb -Repository NuGet\nImport-Module psinfluxdb\nGet-Command -Module psinfluxdb\nGet-InfluxDatabases -server 192.168.3.102\nGet-InfluxDatabases -server 192.168.3.102 -creat -database PowerShell\n```\n\n- Configure script to send the data and check it out in the console\n\nLocal:\n\n```PowerShell\n# Inport-Module \"C:\\Users\\lifailon\\Documents\\PowerShell\\Modules\\HardwareMonitor\"\nwhile ($True) {\n    $Data = Get-Sensor | Where-Object {($_.SensorName -match \"Temperature\") -or ($_.SensorType -match \"Temperature\")}\n    Send-SensorToInfluxDB -Data $Data -ServerInflux \"192.168.3.102\" -Port 8086 -Database \"PowerShell\" -Table \"HardwareMonitor\"\n    Start-Sleep -Seconds 5\n}\n```\n\nRemote:\n\n```PowerShell\n# Inport-Module \"C:\\Users\\lifailon\\Documents\\PowerShell\\Modules\\HardwareMonitor\"\nwhile ($True) {\n    $Server_List = @(\n        \"192.168.3.99\"\n        \"192.168.3.100\"\n    )\n    foreach ($Server in $Server_List) {\n        $Data = Get-Sensor -ComputerName $Server -Port 8085 | Where-Object {($_.SensorName -match \"Temperature\") -or ($_.SensorType -match \"Temperature\")}\n        Send-SensorToInfluxDB -ComputerName $Server -Data $Data -ServerInflux \"192.168.3.102\" -Port 8086 -Database \"PowerShell\" -Table \"HardwareMonitor\"\n        Start-Sleep -Seconds 5\n    }\n}\n```\n\n- Check the received data\n\nSQL query for InstalDB Studio:\n\n```SQL\nSELECT * FROM \"HardwareMonitor\" WHERE time \u003e now() - 5m\n```\n\nFiltering the data:\n\n```SQL\nSELECT * FROM \"HardwareMonitor\" WHERE SensorName =~/.+Package/ and Value \u003e 90 and time \u003e now() - 30m\n```\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/InfluxDB-Data.jpg)\n\nGetting and filtering data via PowerShell:\n\n```PowerShell\nGet-InfluxTables -server 192.168.3.102 -database PowerShell\n$Data =  Get-InfluxData -server 192.168.3.102 -database PowerShell -table HardwareMonitor -minutes 30\n$Data | Where-Object {$_.SensorName -match \"Package\" -and $_.Value -gt 90} | Format-Table\n```\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/psinfluxdb-data.jpg)\n\n💡 The example in the screenshot uses the [oh-my-posh](https://github.com/JanDeDobbeleer/oh-my-posh) theme [System-Sensors](https://github.com/Lifailon/oh-my-posh-themes-performance) to retrieve data from LibreHardwareMonitor.\n\n## 🔔 Creat service\n\nSave the data sending script to database and specify the path to it at the beginning of the script creat service (a set of [scripts](https://github.com/Lifailon/PowerShell.HardwareMonitor/tree/rsa/Service) for creating, starting, stopping and deleting a service are included with the module):\n\n```PowerShell\n$script_path = \"$home\\Documents\\Write-SensorToInfluxDB.ps1\" # set the path to your script\n\n# Install nssm\n$nssm_path = $(Get-ChildItem $env:TEMP | Where-Object Name -match \"nssm\")\nif ($null -eq $nssm_path) {\n    Invoke-RestMethod -Uri \"https://nssm.cc/release/nssm-2.24.zip\" -OutFile \"$env:TEMP\\nssm.zip\"\n    Expand-Archive -Path \"$env:TEMP\\nssm.zip\" -DestinationPath $env:TEMP\n    Remove-Item -Path \"$env:TEMP\\nssm.zip\"\n}\n\n# Delete service\nif (Get-Service HardwareMonitor -ErrorAction Ignore) {\n    Get-Service HardwareMonitor | Stop-Service\n    Remove-Service HardwareMonitor\n    # Для удаления в PowerShell 5.1\n    # (Get-CimInstance win32_service -Filter 'name=\"HardwareMonitor\"').Delete()\n    # \u0026 $nssm_exe_path remove HardwareMonitor\n}\n\n# Creat service\n$service_name  = \"HardwareMonitor\"\n$nssm_exe_path = $(Get-ChildItem $env:TEMP -Recurse | Where-Object name -match nssm.exe | Where-Object FullName -Match win64).FullName\n$pwsh_path     = $(Get-Command pwsh.exe).Source\n\u0026 $nssm_exe_path install $service_name $pwsh_path \"-File $script_path\"\n\u0026 $nssm_exe_path set $Service_Name description \"Sending HardwareMonitor sensors to the InfluxDB\"\n\u0026 $nssm_exe_path set $service_name AppExit Default Restart\n\n# Start service\nGet-Service HardwareMonitor | Start-Service\nGet-Service HardwareMonitor\n```\n\n## 📈 Grafana dashnoard\n\n- Install [Grafana Enterprise](https://grafana.com/grafana/download).\n\nExample for Ubuntu:\n\n```Bash\napt-get install -y adduser libfontconfig1 musl\nwget https://dl.grafana.com/enterprise/release/grafana-enterprise_10.3.1_amd64.deb\ndpkg -i grafana-enterprise_10.3.1_amd64.deb\nsystemctl start grafana-server\nsystemctl status grafana-server\n```\n\n- Dashboard settings.\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/Grafana-Dashboard.jpg)\n\nFor simple setting (without using variables or regular expressions), use grouping by host and hardware name tags and filters by sensor name:\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/InfluxDB-Query.jpg)\n\nFor clarity and convenience, customize the celsius data type and legends (displaying minimum, maximum, and average readings for the specified time period):\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/Grafana-Legend-Celsius.jpg)\n\nMonitoring two hosts:\n\n![Image alt](https://github.com/Lifailon/PowerShell.HardwareMonitor/blob/rsa/Screen/Grafana-Dashboard-Group.jpg)\n\n## Deployment\n\nFor deployment LibreHardwareMonitor as a monitoring agent and collect data on a single computer from multiple machines simultaneously, you can use the following approach via the **WinRM protocol** (you must have administrator rights in the domain and have the appropriate group policies configured beforehand):\n\n```PowerShell\n$ServerList = (\n    \"server-01\",\n    \"server-02\"\n)\nforeach ($Server in $ServerList) {\n    Invoke-Command $Server -ScriptBlock {\n        # Install LibreHardwareMonitor\n        $path = \"$home\\Documents\\LibreHardwareMonitor\"\n        $zip = \"$($path).zip\"\n        $url = \"https://api.github.com/repos/LibreHardwareMonitor/LibreHardwareMonitor/releases/latest\"\n        $url_down = $(Invoke-RestMethod $url).assets.browser_download_url\n        Invoke-RestMethod $url_down -OutFile $zip\n        Expand-Archive -Path $zip -DestinationPath $path\n        Remove-Item -Path $zip\n        # Run Web-Server\n        $Config = Get-Content \"$path\\LibreHardwareMonitor.config\"\n        $Config = $Config -replace 'key=\"runWebServerMenuItem\" value=\"false\"','key=\"runWebServerMenuItem\" value=\"true\"'\n        #$Config = $Config -replace 'key=\"listenerPort\" value=\"8085\"','key=\"listenerPort\" value=\"8086\"'\n        $Config = $Config -replace 'key=\"minTrayMenuItem\" value=\"false\"','key=\"minTrayMenuItem\" value=\"true\"'\n        $Config = $Config -replace 'key=\"minCloseMenuItem\" value=\"false\"','key=\"minCloseMenuItem\" value=\"true\"'\n        $Config | Out-File \"$path\\LibreHardwareMonitor.config\"\n        # Run Application\n        Start-Process \"$path\\LibreHardwareMonitor.exe\" -WindowStyle Hidden\n    }\n}\n```\n\nDownloads the latest version from the GitHub repository, customizes the configuration file and starts the process.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifailon%2Fpowershell.hardwaremonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifailon%2Fpowershell.hardwaremonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifailon%2Fpowershell.hardwaremonitor/lists"}