文章目录

  • SIGUSR1
  • 示例
  • 帮助

SIGUSR1

如果是monit管理的进程,需要注意monit有可能会发送SIGUSR1 到进程。
https://github.com/arnaudsj/monit/blob/aa491f6ca2d2dd79abebf1e97b6f3a14fd4453e8/monitor.c

示例

#set poll interval of 5 seconds
set daemon 5 // 5秒走一个cycle。

#set logfile
set logfile /var/opt/log/monit/monit.log

#set the state file for the critical monit daemon
set statefile /var/opt/lib/monit/critical_daemons.state

#monitor the abc status file
检查文件 abc.status, 路径是 /var/opt/lib/monit/abc.status
check file abc.status with path /var/opt/lib/monit/abc.status
if size > 0 B then exec “/opt/share/monit/monit_alarm -d d” // 如果文件大小大于0B,就要执行命令
repeat every 1 cycles // 每一个cycle 都要做
if does not exist for 5 cycles then exec “/usr/bin/touch /var/opt/lib/monit/abc.status” // 如果5个cycle 没有检查到文件,就touch 一下。

帮助

#/bin/monit -h
Usage: monit [options]+ [command]
Options are as follows:
-c file Use this control file
-d n Run as a daemon once per n seconds
-g name Set group name for monit commands
-l logfile Print log information to this file
-p pidfile Use this lock file in daemon mode
-s statefile Set the file monit should write state information to
-I Do not run in background (needed when run from init)
–id Print Monit’s unique ID
–resetid Reset Monit’s unique ID. Use with caution
-B Batch command line mode (do not output tables or colors)
-t Run syntax check for the control file
-v Verbose mode, work noisy (diagnostic output)
-vv Very verbose mode, same as -v plus log stacktrace on error
-H [filename] Print SHA1 and MD5 hashes of the file or of stdin if the
filename is omited; monit will exit afterwards
-V Print version number and patchlevel
-h Print this text
Optional commands are as follows:
start all - Start all services
start - Only start the named service
stop all - Stop all services
stop - Stop the named service
restart all - Stop and start all services
restart - Only restart the named service
monitor all - Enable monitoring of all services
monitor - Only enable monitoring of the named service
unmonitor all - Disable monitoring of all services
unmonitor - Only disable monitoring of the named service
reload - Reinitialize monit
status [name] - Print full status information for service(s)
summary [name] - Print short status information for service(s)
report [up|down|…] - Report state of services. See manual for options
quit - Kill the monit daemon process
validate - Check all services and start if not running
procmatch - Test process matching pattern

monit:配置/SIGUSR1相关推荐

  1. monit 内存 监控_如何借助Monit搭建服务器监控系统?(1)

    许多Linux管理员依赖一种集中式远程监控系统(比如Nagios或Cacti),检查网络基础设施的健康状况.虽然集中式监控系统为管理员在处理许多主机和设备时简化了工作,但专用的监控设备显然成了单一故障 ...

  2. Monit监控软件安装

    Monit是一款功能非常丰富的进程.文件.目录和设备的监测软件,适用于Linux/Unix平台.官网地址:https://mmonit.com/ 在CentOS 6.4上配置Monit的步骤: 我们以 ...

  3. 【Web】Monit监控程序使用

    简介 Monit是一款Unix/Linux上使用的系统监控程序,对应的官网是https://mmonit.com/monit/.它能够监控的内容包括进程.文件和目录.系统状态等等,也能对错误进行修复. ...

  4. Linux下monit进程管理操作梳理--转载

    本文转自 (https://cloud.tencent.com/developer/article/1027097) Monit对运维人员来说可谓神器,它是一款功能非常丰富的进程.文件.目录和设备的监 ...

  5. linux monit安装配置

    Monit安装与配置 一.简介 Monit是一个在类unix平台下用于监视进程.文件.目录和设备的软件,可以修复停止运作或运作异常的程序,适合处理那些由于多种原因导致的软件错误. 二.安装 假定下面的 ...

  6. monit mysql_monit 配置详解(monitrc)

    monitrc是Monit的主配置文件(控制文件). monitrc的内容主要分为全局(golbal)和服务(services)两个部分. 默认情况下monitrc文件在/etc/monit目录下. ...

  7. monit mysql_monit安装配置

    环境centos5(32bit),monit-5.17.1,下载地址 https://bitbucket.org/tildeslash/monit/downloads/ 1.tar zxvf moni ...

  8. monit mysql_monit介绍和配置

    1.介绍 monit监控和管理进程.程序.文件.目录和Unix系统的文件的工具.可以进行自动维护和修理,在错误的情况下执行有意义的因果关系的行动.比如,某个进程没有运行启动它:没有响应重启它:占用太多 ...

  9. monit监控mysql_monit监控软件安装配置

    monit很不错的监控软件,下载安装如下: wget http://mmonit.com/monit/dist/monit-5.1.1.tar.gz #最新的版本可能不是这个 tar xzvf mon ...

最新文章

  1. 向阿里学数字化转型,驱动业绩新增长
  2. AAuto解析电话薄 VCF文件ENCODING=QUOTED-PRINTABLE编码解码
  3. freebsd用户密码文件
  4. Oracle Golden Gate 系列十一 -- 配置 GG DDL 同步 说明 与 示例
  5. hashMap put方法 第二行代码
  6. 献礼724运维日 | 首届腾讯运维技术开放日讲了啥? (附演讲PPT领取方式)
  7. PyTorch系列 | 如何加快你的模型训练速度呢?
  8. 曝华为新成立10大预备军团;被罚2500万欧元,苹果开放第三方支付;GitLab 14.8发布 | 极客头条...
  9. JS中的单引号和双引号
  10. ERA5气象数据 :数据中相对湿度、边界层高度、温度、风向、地面气压等参数下载详细教程
  11. 向境外支付软件测试费,支付宝怎么打开境外支付?境外支付有手续费吗?
  12. 拍照的时候怎么让表情自然?
  13. 【更新】Kendo UI for jQuery发布R2 2018|附下载
  14. java+OpenCV3 +百度OCR(或tesseract) 识别表格数据
  15. Python3飞机大战全代码(亲测OJBK)
  16. 基于C语言开发Linux平台的协议分析软件
  17. pdfminer库解析,使用pdfminer进行信息抽取
  18. 腾讯云服务器如何使用Cloudreve 应用镜像搭建个人云盘?
  19. android图片下载到本地
  20. 增发竟是“局中局”?火牛视频搬起石头砸自己的脚

热门文章

  1. 移动端开发注意事项、需要注意的问题、特殊属性、精灵图、座固定有自适应的布局
  2. https证书不合法
  3. 后端SpringBoot和前端vue
  4. oracle同义词详解
  5. 射频电路设计的常见问题及五大经验总结
  6. 高考后,学会这种能力,让你收益终生!
  7. UVALive - 5542 Commedia dell' arte 三维n数码问题
  8. ITK—hessian矩阵计算实现及应用
  9. Websocket如何实现长连接
  10. wordpress常用函数手册