Polymonitor可以作为一个独立的CLI工具来快速检查URL的状态,也可以作为polybar的插件。
polymonitor的Python项目详细描述
多监视器
Polymonitor可以用作独立的CLI工具来快速检查URL的状态,也可以用作polybar的插件。在
安装
使用包管理器pip安装polymonitor。在
$ pip install polymonitor
或者,您可以克隆git存储库并使用Poetry安装它。在
^{pr2}$使用
polymonitor --help usage: Displays site status for polybar. [-h][-s][-c][-u URLS [URLS ...]] optional arguments: -h, --help show this help message and exit -s, --symbolic Displays the results as symbols -c, --compact Reduces the results into a more compact package -u URLS [URLS ...], --urls URLS [URLS ...] Pass in URLs to monitor
一个基本的用例是快速打印您要检查的web应用程序的状态:
$ polymonitor -cu duckduckgo.com google.com google.com/404
Up: 2 Down: google.com/404
请注意,您不需要在url前面加上协议(例如,https://
)。如果不提供完整的URL,则在ping之前,https://
将作为您的URL的前缀。在
您可以不使用-c
标志以获得更详细的输出:
$ polymonitor -cu duckduckgo.com google.com google.com/404 google.com: Up google.com/404: Down duckduckgo.com: Up
Polybar使用
如果要在polybar中使用此工具,则需要将以下内容添加到polybar配置中:
[module/polymonitor] type = custom/script exec = polymonitor -cu duckduckgo.com google.com twitter.com cloudflare.com interval = 10800
以上配置将生成:
请注意,如果您使用此方法ping自己的网页,则可能需要将间隔提高为仅每隔两小时刷新一次。间隔以秒为单位,因此一小时为interval = 3600
,并且上面的示例将每三小时刷新一次。在
贡献
欢迎拉取请求。对于重大变化,请先打开一个问题,讨论您希望更改的内容。在
请确保根据需要更新测试。在
许可证
- 项目
标签: