Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件,适用于Linux/Unix平台。 它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误,同时Monit 包含一个内嵌的 HTTP(S) Web 界面,你可以使用浏览器方便地查看 Monit 所监视的服务器。Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件,用于Unix平台。 它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误。monit运行于应用层。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。Monit可以监控服务器进程状态、HTTP/TCP状态码、服务器资源变化、文件系统变动等等,根据这些变化,可以设定邮件报警、重启进程或服务。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。
What Monit can do
Proactive adj. 积极主动的; 前摄的; 主动出击的; 先发制人的;
Monit can act if an error situation should occur, e.g.; if sendmail is not running, Monit can start sendmail again automatically or if apache is using too much resources (e.g. if a DoS attack is in progress) Monit can stop or restart apache and send you an alert message. Monit can also monitor process characteristics, such as; how much memory or cpu cycles a process is using.
Processes
You can use Monit to monitor daemon processes or similar programs running on localhost. Monit is particularly useful for monitoring daemon processes, such as those started at system boot time from /etc/init/ For instance sendmail, sshd, apache and mysql.
Files, Dirs and Filesystems
You can also use Monit to monitor files, directories and filesystems on localhost. Monit can monitor these items for changes, such as timestamps changes, checksum changes or size changes. This is also useful for security reasons - you can monitor the md5 or sha1 checksum of files that should not change and get an alert or perform an action if they should change.
Cloud and Hosts
Monitor network connections to various servers, either on localhost or on remote hosts. TCP, UDP and Unix Domain Sockets are supported. Network tests can be performed on a protocol level; Monit has built-in tests for the main Internet protocols, such as HTTP, SMTP etc. Even if a protocol is not supported you can still test the server as you can configure Monit to send any data and test the response from the server.
Programs and scripts
Monit can be used to test programs or scripts at certain times, much like cron, but in addition, you can test the exit value of a program and perform an action or send an alert if the exit value indicates an error. This means that you can use Monit to perform any type of check you can write a script for.
System
Finally, Monit can be used to monitor general system resources on localhost such as overall CPU usage, Memory and Load Average.
下面是一个简单的例子,配置文件中已经包含了大量的例子,可以看配置文件参考。
set daemon 120 #设置检测时间
set logfile /var/log/monit.log #monit日志
set alert www@vpser.net with reminder on 1 cycle #出现1次错误的时候发报警邮件到指定的邮箱
set mailserver mail.vpser.net #设置邮件服务器
set httpd port 2812 and # 设置http监控页面的端口
use address 74.207.246.99 # http监控页面的IP
allow localhost # 允许本地访问
allow 123.23.45.0/24 # 允许此IP段访问
#allow 0.0.0.0/0.0.0.0 # 允许所有IP访问
allow username:password #设置访问用户名密码
#检测sshd服务
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
#检测mysql服务
check process mysql with pidfile /usr/local/mysql/var/vpser.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout
#检测nginx服务
check process nginx with pidfile /usr/local/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
if failed host www.vpser.net port 80 protocol http
then restart
配置中的pid及启动、关闭脚本的路径一定要是全路径,且参数一定要正确否则会造成无法正常检测或正常启动。
相关推荐
centos6.5 monit 监控 性能 程序自动化监控
如何借助Monit搭建服务器监控系统-.docx
监控面板 描述 一目了然的Python Web应用程序可获取一堆服务器的仪表板。 屏幕截图 每个Monit服务器未找到警报时的主视图: 一个Monit代理正在报告服务器上的错误: 展开服务器,上面有错误的问题: 它是如何...
用于监控管理linux系统内进程、文件、服务等内容的程序,且提供web可视化界面。
monit软件可监控软件部署服务端口及名称,使用方便切软件规模小
Monit是unix系统上用于管理监视进程、文件、目录及设备的工具。Monit提供自动维护和修复功能,并能在出错时执行相应的关联的行为。比如monit可以开启一个进程(当它没有正常运行),重启一个进程(如果它没有反应)...
监控进程,守护进程,实时拉起进程,监控工具脚本,用于程序拉起,监控程序状态,程序停止,启动等功能.....
Docker化监控克隆这个 repo。 编辑以设置您的配置。 在 conf.d 中添加要监视的服务/进程的配置比如可以在... Monit 图像已准备就绪,可以作为docker run -d -p 2812:2812 调用Monit 现在正在运行并且可以在<host>:2812
Ansible-monit.zip,配置monit的ansible角色。还将设置ssh、ntp和cron.anxs-monit的基线监视,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
许多知名的云计算服务提供商都采用Linux系统作为其基础架构,一些游戏平台和游戏开发工具采用Linux作为支持的操作系统,例如Steam平台上的某些游戏。Linux系统在科学计算、数据分析和机器学习等领域也有广泛应用。...
狗包 Monit群集管理工具。 正在开发中。执照MIT许可证。 版权所有(c)2013
monit_bin 食谱 从源安装monit。 包括设置工具monitensite、monitdisite。 为创建的配置添加 LWRP。... 这些工具控制 monit 设置,如 a2ensite、a2disite。 把你的配置文件放到/etc/monit/conf.ava
Monit是一个免费的开源实用程序,用于管理和监视UNIX系统上的进程、程序、文件、目录和文件系统。Monit进行自动维.zip
监控的基本图像docker-monit是一个映像,已配置为可直接使用或用作监控守护程序更多自定义应用程序的基础。 docker-monit可用于从提取该图像包括监控版本5.13概述此映像将monit安装到以下位置: / opt / monit Monit...
该项目以Linux内核为核心,围绕其构建了一个完整的操作系统,包括各种系统工具、库、应用程序和硬件支持。 以下是Linux项目的一些主要特点和资料介绍: 开放源代码:Linux项目的所有源代码都是公开的,并允许任何...
# 是一个免费的开源实用程序,用于管理和监控 UNIX 系统上的进程、程序、文件、目录和文件系统。 Monit 进行自动维护和修复,并可以在错误情况下执行有意义的因果操作。# 系统要求 内存和磁盘空间。 至少需要 1 兆...
监控 Ansible角色,用于安装Monit并设置服务监视。 用法(示例) 典型的最小用法: - role : monit 在不安装和使用自定义服务的情况下配置monit: - role : monit monit_setup : configure monit_custom_...
Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件。它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误。
monit-5.4.tar.gz qsdk 编译包
工头::监控 小命令行也可以从 Procfile 导出到监控控制文件 安装 将此行添加到应用程序的 Gemfile 中: gem 'foreman-monit', github: 'capita/foreman-monit' or gem 'foreman-monit, '~> v1.0.4' 然后执行: $...