受限企业环境下的Python分布式应用架构

发布于 2024-11-15 00:20:42 字数 1074 浏览 2 评论 0原文

这是我的场景:我开发了一个 Python 桌面应用程序,用它来探测运行它的同一台机器上的服务/数据库的状态。

我的需要是使用我的应用程序监视两个“兄弟”Window Server 2003 主机(两者的 Python 版本都是 2.5)。其中一台主机位于我自己的 LAN 中,另一台位于可通过 VPN 访问的另一个 LAN 中。

该应用程序由以下部分组成:

  1. 图形用户界面 (gui.py),它提供小部件来收集用户输入并启动...
  2. ...业务逻辑脚本 (console.py),它依次调用从属 Python 脚本来检查系统的服务和数据库使用情况/帐户状态/ecc。然后,这些检查的文本输出将返回到 GUI。

我曾经直接在两台机器上执行该应用程序,但如果将其转换为客户端/服务器应用程序,那就太好了,这样:

  • 用户只需在本地运行 gui.py
  • gui.py 应该将参数传递给 console.py 的一些服务器重制版,这些重制版将在两台 Windows 主机上运行,
  • ​​然后服务器将执行系统检查和将结果报告给将显示结果的客户端 GUI。

我考虑了两种可能的解决方案:

  1. 在每个 Windows 主机上创建一个 Windows 服务,基本上执行 console.py 的代码并等待来自客户端的传入请求
  2. 打开从任何 LAN 主机到合格的Windows主机并直接在其上运行console.py

我正在一个企业环境中工作,该环境有一些网络和主机限制:许多网络协议(如 SSH)都被我们的企业防火墙过滤。此外,我没有 Windows 主机的管理权限,因此我无法在它们上安装系统服务...这令人沮丧!

我只是想问是否还有其他方法可以使 gui.pyconsole.py 通过网络进行通信,但我没有考虑到。有人有什么建议吗?请注意,如果可能的话,我不会要求 ICT 部门授予我 Windows 主机的管理权限!

提前致谢!

This is my scenario: I developed a Python desktop application which I use to probe the status of services/DBs on the very same machine it is running on.

My need is to monitor, using my application, two "brother" Window Server 2003 hosts (Python version is 2.5 for both). One of the hosts lies in my own LAN, the other one lies in another LAN which is reachable via VPN.

The application is composed by:

  1. A Graphical User Interface (gui.py), which provides widgets to collect user inputs and launches the...
  2. ...business-logic script (console.py), which in turn invokes slave Python scripts that check the system's services and DB usage/accounts status/ecc. The textual output of those checks is then returned back to the GUI.

I used to execute the application directly on each the two machines, but it would be great to turn it into a client/server application, so that:

  • users will just be supposed to run the gui.py locally
  • the gui.py will be supposed to communicate parameters to some server remakes of console.py which will be running on both of the Windows hosts
  • the servers will then execute system checks and report back the results to the client GUIs which will display them.

I thought about two possible solutions:

  1. Create a Windows service on each of the Windows hosts, basically executing console.py's code and waiting for incoming requests from the clients
  2. Open SSH connections from any LAN host to the eliged Windows host and directly run console.py on it.

I am working on a corporate environment, which has some network and host constraints: many network protocols (like SSH) are filtered by our corporate firewall. Furthermore, I don't have Administration privileges onto the Windows hosts, so I can't install system services on them...this is frustrating!

I just wanted to ask if there is any other way to make gui.py and console.py communicate over the network and which I did not take into account. Does anyone have any suggestion? Please note that - if possible - I'm not going to ask ICT department to give me Administration privileges on the Windows hosts!

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-11-22 00:20:42

对自己的回答:我找到了一个可能的解决方案..

我很幸运,因为 console.py 脚本实际上调用了许多从属 python 脚本,每个脚本都通过标准第三方命令执行一个系统检查可以启动该工具来检查远程主机上的功能。

然后,我所做的就是修改 gui.pyconsole.py,以便用户可以参数化地指定必须在哪个 Windows 主机上执行检查。
通过这种方式,我可以获得一个分布式应用程序...但我很幸运,如果一个或多个第三方 CL 工具不支持远程主机功能检查怎么办?

Answer to myself: I found one possible solution..

I'm lucky because the console.py script is actually invoking many slave python scripts, each of them performing one single system check via standard third-party command-line tools which can be fired to check features on remote hosts.

Then, what I did was to modify the gui.py and console.py so that users can parametrically specify on which Windows host the checks must be carried out.
In this way, I can obtain a ditributed application...but I've been lucky, what if one or more of the third-party CL tools did not support remote host features checking?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文