monit监控自定义服务

版本:This is Monit version 5.25.1mysql

服务器上跑的公司本身的服务,查看网上写的monit配置监控,都是一些监控常规应用(Nginx、Apache、mysql等)这些监控起来比较简单,都有pid文件,tomcat能够配置生成pid文件,可是公司本身的服务没有pid文件,因而查看monit官网sql

Process

CHECK PROCESS <unique name> <PIDFILE <path> | MATCHING <regex>>

is the absolute path to the program's pid-file. A pid-file is a file, containing a Process's unique ID. If the pid-file does not exist or does not contain the PID number of a running process, Monit will call the entry's start method if defined.tomcat

is an alternative to using PID files and uses process name pattern matching to find the process to monitor. The top-most matching parent with highest uptime is selected, so this form of check is most useful if the process name is unique. Pid-file should be used where possible as it defines expected PID exactly. You can test if a process match a pattern from the command-line using monit procmatch "regex-pattern". This will lists all processes matching or not, the regex-pattern.服务器

除了监控pid文件,还能够匹配进程名来监控this

因而我就试了一下spa

当进程不存在,则自动重启并报警code

还算不错,完事orm

相关文章
相关标签/搜索