定制 perf2k2/monitre 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

perf2k2/monitre

Composer 安装命令:

composer require perf2k2/monitre

包简介

PHP library for remote linux monitoring/diagnostic with no installation needed

README 文档

README

Build Status

About

Library for connecting to remote linux systems and reading key performance and other metrics. Maybe useful for periodic checking remote machine state and logging situations with wrong values.

How it works

It uses classes called "monitors" for checking metrics. After connecting to remote host by ssh, monitor runs linux command and parse output for getting information.

List of monitors

  • Memory
    • Usage percent
  • Disk
    • Usage percent (by mount path)
  • File (by absolute path)
    • Size
    • Modify time
    • Content
    • Last lines
    • Header lines

Requirements

  • PHP >= 7.2
  • ext-ssh2

Installation

composer require perf2k2/monitre

Usage

$logger = new Logger();
$server = new Connection('ip', new PasswordAuthenticator('user', 'password'));

$memoryMonitor = new MemoryUsageMonitor($server);
if ($memoryMonitor->getUsagePercent() > 90) {
    $logger->warning('High memory usage!');
}

$diskMonitor = new DiskUsageMonitor($server);
if ($diskMonitor->getUsagePercent() > 90) {
    $logger->warning('High disk usage!');
}

$fileMonitor = new FileMonitor($server, '/path/to/file');
if ($fileMonitor->getSize()->asMegabytes() > 100) {
    $logger->warning('File too large!');
}

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固