服务监控
监测服务
一杯雪花勇闯天涯
越努力越幸运
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
基于php+swoole+shell 当服务器磁盘空间不足时,实现邮件报警的一种思路
实现的代码逻辑如下:class Disk{ public function shell() { $shell = " df -hl | head -n 2 "; $result = exec($shell); $arr= explode(" ",$result); //总磁盘空间使用率 $disk_use = $arr[12]; $disk_use = str_replace("%",原创 2020-08-24 22:44:21 · 275 阅读 · 0 评论 -
基于php+shell实现监测swoole的服务是否运行正常的一种思路
我们知道swoole的服务都是在命令行模式下面运行的,那么我怎么知道它的服务是一种运行正常的呢?下面我就聊聊我的实现方案吧我们知道在php中api中提供了一个执行shell的函数shell_exec — 通过 shell 环境执行命令,并且将完整的输出以字符串的方式返回。没错,这就是php官方对这个函数的介绍,是不是超级简单那么是怎么做的,我就直接上代码了<?phpclass Shell{ CONST port = 80 ; public function原创 2020-08-24 22:19:06 · 595 阅读 · 0 评论
分享