Skip to content

lixingke3650/OrMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OrMonitor

Linux 程序监控工具


用于监控服务或后端进程,退出后可自行重启。

使用前提:

  1. 已安装start-stop-daemon工具
  2. 需指定监控进程的pid文件(若监控对象不生成,则由start-stop-daemon自动生成,请参考ormonitor.conf中的配置样例)
    (程序中默认使用了start-stop-daemon的 -pidfile-m 参数,请注意监控对象是否自行生成pid文件及该文件路径)

执行原理:

  1. 判断pid文件是否存在,不存在则认为监控对象未启动.重启.
  2. 若存在则读取pid文件中保存的pid号,并判断该pid进程是否存在.不存在则删除pid文件并重启.
  3. 监控周期使用定时器(setitimer)实现.

待完成:

  1. 以守护进程形式启动.

2014.10.14

About

Linux 程序监控工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages