undercloud/beholder

dev-master 2017-09-07 08:52 UTC

This package is auto-updated.

Last update: 2024-08-28 07:20:21 UTC


README

linux进程监控器

安装

composer require unercloud/beholder=dev-master

配置

screen

检查是否已安装 screenpidof,如果没有安装,请安装它们

crontab

添加 crontab 任务(默认2分钟)

  1. 打开终端
  2. 输入 crontab -e
  3. 添加以下行 /2 * * * * /usr/bin/php /path/to/beholder/index.php > /dev/null 2>&1

监控

打开 /path/to/beholder/Queue.php 并添加要监控的进程

<?php
    return [
	// section for binary files like apache, nginx, mysql
		'pidof' => [ 
			'apache2' => '/usr/sbin/apache2ctl -k start'		
		],
		//section for jobs running in screen
		'screen' => [
			'nodeserver' => 'screen -AdmS nodeserver node /path/to/script.js'
		]
	];
?>

日志

打开 /path/to/beholder/Settings.php 并在 logpath 部分添加日志路径。