小赖子的英国生活和资讯

增加两API: cal 和 uptime

阅读 桌面完整版

uptime

uptime 是个系统监测工具, 它会返回过去1分钟5分钟和15分钟的平均 负载 (Load Average). 如果 1 个CPU 当负载超过1的时候就得小心了 如果 2核的CPU 负载为2为比较正常, 以此类推.

1
2
没带参数的情况返回如下:
 21:49:27 up 4 days, 23:38,  2 users,  load average: 0.22, 0.27, 0.16
没带参数的情况返回如下:
 21:49:27 up 4 days, 23:38,  2 users,  load average: 0.22, 0.27, 0.16

同时支持以下参数:

1
2
3
4
5
6
7
8
9
10
Usage:
 uptime [options]
 
Options:
 -p, --pretty   show uptime in pretty format
 -h, --help     display this help and exit
 -s, --since    system up since
 -V, --version  output version information and exit
 
For more details see uptime(1).
Usage:
 uptime [options]

Options:
 -p, --pretty   show uptime in pretty format
 -h, --help     display this help and exit
 -s, --since    system up since
 -V, --version  output version information and exit

For more details see uptime(1).

例子:

1
2
3
4
root@uploadbeta:/run/blog/cache8# uptime -p
up 4 days, 23 hours, 38 minutes
root@uploadbeta:/run/blog/cache8# uptime -s
2015-06-23 22:11:25
root@uploadbeta:/run/blog/cache8# uptime -p
up 4 days, 23 hours, 38 minutes
root@uploadbeta:/run/blog/cache8# uptime -s
2015-06-23 22:11:25

API 访问地址为: https://helloacm.com/api/uptime/
参数, p=-p or p=-h or p=-V or p=-s
返回 JSON字符串

cal

cal 是LINUX的文本命令行日历, 当没有给任何参数的时候 它返回当前月份.

API: https://helloacm.com/cal/
API 访问地址为: https://helloacm.com/api/cal/

API 调用例子

英文: https://helloacm.com/two-linux-api-added-uptime-and-cal/

强烈推荐

微信公众号: 小赖子的英国生活和资讯 JustYYUK

阅读 桌面完整版
Exit mobile version