本文介绍了通过python中的套接字的简单服务器/客户端监控工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在酒吧里有很多物联网 RPI.
我需要监控我的 RPI 并监控许可证、服务、磁盘空间等...
我已经开始在服务器和客户端上工作.

我被困住了,我不知道,什么会更好:
1) 客户端将与服务器保持持久连接
2) 客户端只有在收集到一些数据时才会连接到服务器(例如每五分钟的 cron 收集磁盘使用情况)

你们觉得怎么样?
我知道,已经有很多工具了,但我需要自己制作,因为会有很多具体的东西需要监控.
如果你有一些提示,也请与我分享:)

I have many RPIs for IoT in pubs.
I need to monitor my RPIs and monitor licenses, services, disk space etc...
I have started to work on both server and client.

I am stucked, that I don't know, what will be better:
1) Client will have persistent connection with server
2) Client will connect to server only when some data are collected(for example cron every five minutes collects disk usage)

What do you think guys?
I know, that there are many tools already, but I need to make my own, because there will be many specific things to monitor.
If you have some tips, share it also with me please :)

推荐答案

我会选择只有在收集到一些数据时客户端才会连接到服务器(例如每五分钟收集一次磁盘使用情况的 cron 作业)".

I would go with "Client will connect to the server only when some data is collected (for example with a cron job every five minutes that collects disk usage)"[edited].

另外,不要使您的问题过于复杂:例如不要编写您自己的消息格式或 TCP 等效格式.

Also, do not overcomplicate your problem: E.g. do not write your own message format or TCP equivalent.

只需使用 JSON、BSON 或 XML,代码应该很容易编写.

Just use JSON, BSON or XML and the code should be fairly easy to write.

如果您需要安全性并且不希望第三方听取您的磁盘使用情况报告,请使用 ssl 包,如此处.

If you need security and do not want third parties to listen to your disk usage reports use the ssl package like here.

这篇关于通过python中的套接字的简单服务器/客户端监控工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:54