gigasavvy/uptime

此包已被废弃且不再维护。作者建议使用https://github.com/GigaSavvy/uptyme包。

基于CLI的脚本来验证网站是否运行。

v0.1.3 2017-06-19 02:18 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:07:51 UTC


README

Uptyme是一个PHP CLI脚本来验证网站的运行时间。

为什么拼写为Uptyme,你代码潮人吗?

uptime是Linux命令,用于检查系统运行时间。显然,我们不可能使用这个名字!

安装

composer global require gigasavvy/uptyme

使用

Uptyme应从命令行运行,可以使用多种方式。

基本检查

要检查单个网站是否运行,使用以下命令

$ uptyme run https://gigasavvy.com
Checking HTTPS integrity of the given domains...
Checker completed with 0 failed domains.

要检查多个网站是否运行,只需将额外的域名作为参数传递

$ uptyme run https://gigasavvy.com https://google.com https://php.ac.cn
Checking HTTPS integrity of the given domains...
Checker completed with 0 failed domains.

日志记录

要启用日志(适用于基于cron的运行),将日志文件传递给--log选项

$ uptyme run https://gigasavvy.com --log /var/log/uptyme.log
Checking HTTPS integrity of the given domains...
Checker completed with 0 failed domains.
Check logs for more info (/var/log/uptyme.log)

Slack集成

对于任何失败的网站,您可以通过传递您的Slack webhook url到--slack选项通过Slack提醒

$ uptyme run https://foo.bar --slack https://hooks.slack.com/services/123/456
Checking HTTPS integrity of the given domains...
Checker completed with 1 failed domains.
Failed domains:
https://foo.bar

正如我们所见,网站https://foo.bar未能连接。通过传递--slack选项,您的Slack频道也将被通知。