Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takuya/php-lmsensors-wrapper
lmsensors cpu temperature to json
https://github.com/takuya/php-lmsensors-wrapper
Last synced: 21 days ago
JSON representation
lmsensors cpu temperature to json
- Host: GitHub
- URL: https://github.com/takuya/php-lmsensors-wrapper
- Owner: takuya
- License: agpl-3.0
- Created: 2022-02-12T06:28:25.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T08:58:03.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T18:53:58.339Z (about 1 month ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-lmsensors-wrapper
lm-sensors cpu temperature to jsoncommand result
```text
acpitz-acpi-0
Adapter: ACPI interface
temp1: +33.0°C (crit = +100.0°C)coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +34.0°C (high = +105.0°C, crit = +105.0°C)
Core 0: +33.0°C (high = +105.0°C, crit = +105.0°C)
Core 2: +34.0°C (high = +105.0°C, crit = +105.0°C)
```
this package will convert result to json
```json
[
{
"Name": "acpitz-acpi-0",
"Adapter": " ACPI interface",
"Temperature": {
"temp1": "+33.0°C (crit = +100.0°C)"
}
},
{
"Name": "coretemp-isa-0000",
"Adapter": " ISA adapter",
"Temperature": {
"Package id 0": "+34.0°C (high = +105.0°C, crit = +105.0°C)",
"Core 0": "+33.0°C (high = +105.0°C, crit = +105.0°C)",
"Core 2": "+34.0°C (high = +105.0°C, crit = +105.0°C)"
}
}
]
```## Install
via packagist
```
composre require takuya/php-lmsensors-wrapper
```
via git
```
[email protected]:takuya/php-lmsensors-wrapper.git
composer config repositories.takuya/php-lmsensors-wrapper vcs $repo
composer require takuya/php-lmsensors-wrapper
```
## Example 01
```php
$obj = new Sensors();
$obj->execute('ssh 192.168.1.1 -- sensors');
$json = $obj->toJson();
```
## Example 02
```php
$obj = new Sensors();
$ret = `ssh 192.168.1.1 -- sensors`
$obj->setResult($ret);
$json = $obj->toJson();
```## requirements
```
sudo apt install lm-sensors
```