Skip to content
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

[Feature request]Add temperature detector #7

Closed
kmvan opened this issue Oct 12, 2018 · 15 comments
Closed

[Feature request]Add temperature detector #7

kmvan opened this issue Oct 12, 2018 · 15 comments

Comments

@kmvan
Copy link
Owner

kmvan commented Oct 12, 2018

Em mm, maybe some server has not temperature module.

@kmvan kmvan changed the title Add temperature detector [Feature request]Add temperature detector Jan 30, 2019
@urusai-me
Copy link
Contributor

换个思路,考虑到各操作系统以及不同服务器架构的读取温度的方法和路径不尽相同,可以将温度独立出来。
这样的话,规定好端口、协议和数据类型就可以了,让用户自己写读取并输出温度的模块。反正读个温度不是什么很复杂的事。
比如用nodejs读取温度,然后用http/ws以json输出到8080端口,如果prober.php在加载这个json时返回的的状态码不是200,则隐藏温度统计。又或者可以直接用php写,在prober.php中require……

@urusai-me
Copy link
Contributor

前不久有个小伙伴想用nodejs写个跟xprober差不多的东西,但是要做成json接口,于是我给他演示了一下读取温度并输出。然后今天突然想起来xprober,就过来回复了。

@kmvan
Copy link
Owner Author

kmvan commented Jan 7, 2020

这个想法不错

@kmvan
Copy link
Owner Author

kmvan commented Jan 7, 2020

[
  {
    "id": "cpu",
    "name": "CPU 温度",
    "celsius": 56.1
  },
  {
    "id": "ambient",
    "name": "环境温度",
    "celsius": 37
  }
]

如果其他程序使用 http://127.0.0.1:端口,输出例如上面的数据,然后探针读取并输出到页面,这样如何?

@urusai-me
Copy link
Contributor

urusai-me commented Jan 8, 2020

对对对,就这意思。
指定一个不常用的高端口就好啦

@kmvan
Copy link
Owner Author

kmvan commented Jan 8, 2020

那就计划使用 2048 或 4096 端口,会探测两次,只要其中之一有数据返回就会输出到相关位置。

@urusai-me
Copy link
Contributor

坐等新版本上线~
图片

@kmvan
Copy link
Owner Author

kmvan commented Jan 9, 2020

坐等新版本上线~
图片

是可以多个数组对象啊,[{...}, {...}],不是只有一个对象的

@urusai-me
Copy link
Contributor

很遗憾我只有一个传感器……

@kmvan
Copy link
Owner Author

kmvan commented Jan 9, 2020

那就应该用 [{...}]

@urusai-me
Copy link
Contributor

直接给数组内容啊……好的

@kmvan
Copy link
Owner Author

kmvan commented Jan 9, 2020

@urusai-me 试试预览版 https://github.com/kmvan/x-prober/tree/dev/dist 下载文件后测试看看?
如果无问题就正式发布了。
已经发布了。

@urusai-me
Copy link
Contributor

可以用了
http://httpd.best

@kmvan
Copy link
Owner Author

kmvan commented Jan 10, 2020

Good~

@kmvan kmvan closed this as completed Jan 10, 2020
@kmvan
Copy link
Owner Author

kmvan commented Jan 11, 2020

扩展模块调整为 extensions 目录了。
3.11版本原生添加了温度检测,如果你的PHP没有限制访问目录的话,那么应该不需要扩展就可以显示温度。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants