- 浏览: 24232 次
- 性别:
- 来自: 上海
最新评论
monit linux监控
- 博客分类:
- 随手笔记
English | VPS常用软件下载 |美国VPS主机推荐|代购服务|10美元以下VPS|VPS新手指南/教程|留言板|关于VPSer| VPS论坛 | 登录 |VPS侦探Monit - Linux系统进程、文件、目录和设备的监测软件
2011年07月21日 上午 | 作者:VPS侦探
Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件,适用于Linux/Unix平台。 它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误,同时Monit 包含一个内嵌的 HTTP(S) Web 界面,你可以使用浏览器方便地查看 Monit 所监视的服务器。
Monit官网:http://mmonit.com/monit/
1、安装Monit
CentOS可以到:http://pkgs.repoforge.org/monit/ 下载对应位数rpm包安装。
32位:wget -c http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.i386.rpm;rpm -ivh monit-5.2.5-1.el5.rf.i386.rpm
64位:wget -c http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.x86_64.rpm;rpm -ivh monit-5.2.5-1.el5.rf.x86_64.rpm
Debian可以直接:apt-get install monit 安装。
2、修改配置文件
CentOS用RPM包安装的话配置文件在: /etc/monit.conf;Debian apt-get安装的话配置文件在:/etc/monit/monitrc;
下面是一个简单的例子,配置文件中已经包含了大量的例子,可以看配置文件参考。
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及启动、关闭脚本的路径一定要是全路径,且参数一定要正确否则会造成无法正常检测或正常启动。
看了一下php-fpm貌似用Monit还不是很好监控。
如果添加了http可以直接使用http://ip:2812 进行管理。
3、启动/停止Monit
CentOS:
chkconfig monit on //加入开机启动
/etc/init.d/monit {start|stop|restart|force-reload|syntax}Debian:
编辑:/etc/default/monit 文件,查找 startup=0 ,将0改为1,保存。update-rc.d -f monit defaults
/etc/init.d/monit {start|stop|restart|force-reload|syntax}当然如果使用监控宝服务也不错,只不过免费版的检测间隔长些、对检测的数量有限制。
如有问题欢迎反馈,欢迎到VPS论坛交流。
原创文章,谢绝转载!
>>转载请注明出处:VPS侦探 本文链接地址:http://www.vpser.net/manage/monit.html
2011年07月21日 上午 | 作者:VPS侦探
Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件,适用于Linux/Unix平台。 它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误,同时Monit 包含一个内嵌的 HTTP(S) Web 界面,你可以使用浏览器方便地查看 Monit 所监视的服务器。
Monit官网:http://mmonit.com/monit/
1、安装Monit
CentOS可以到:http://pkgs.repoforge.org/monit/ 下载对应位数rpm包安装。
32位:wget -c http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.i386.rpm;rpm -ivh monit-5.2.5-1.el5.rf.i386.rpm
64位:wget -c http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.x86_64.rpm;rpm -ivh monit-5.2.5-1.el5.rf.x86_64.rpm
Debian可以直接:apt-get install monit 安装。
2、修改配置文件
CentOS用RPM包安装的话配置文件在: /etc/monit.conf;Debian apt-get安装的话配置文件在:/etc/monit/monitrc;
下面是一个简单的例子,配置文件中已经包含了大量的例子,可以看配置文件参考。
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及启动、关闭脚本的路径一定要是全路径,且参数一定要正确否则会造成无法正常检测或正常启动。
看了一下php-fpm貌似用Monit还不是很好监控。
如果添加了http可以直接使用http://ip:2812 进行管理。
3、启动/停止Monit
CentOS:
chkconfig monit on //加入开机启动
/etc/init.d/monit {start|stop|restart|force-reload|syntax}Debian:
编辑:/etc/default/monit 文件,查找 startup=0 ,将0改为1,保存。update-rc.d -f monit defaults
/etc/init.d/monit {start|stop|restart|force-reload|syntax}当然如果使用监控宝服务也不错,只不过免费版的检测间隔长些、对检测的数量有限制。
如有问题欢迎反馈,欢迎到VPS论坛交流。
原创文章,谢绝转载!
>>转载请注明出处:VPS侦探 本文链接地址:http://www.vpser.net/manage/monit.html
发表评论
-
monit
2015-07-19 15:51 0http://blog.csdn.net/coolboylai ... -
JAVA 持久层三种查询方式
2015-01-04 09:56 396Java JPA有三种查询方式: 1)JPQL 2)Crite ... -
apache2.2设置最大连接数
2014-09-09 10:39 787Apache的最大连接数,默认为256个。 修改ap ... -
linux启动oracle
2014-06-18 12:59 369http://www.360doc.com/content/1 ... -
linux下升级openssh
2013-10-22 19:27 1476查询是否安装telnet # rpm -qa | grep ... -
javascript:history.go()和History.back()的区别
2013-10-09 16:13 671javascript:history.go()和History ... -
struts2中各个jar包的作用
2013-09-13 09:19 628struts2 jar包说明 commons-logging- ... -
js操作SELECT对象
2013-09-02 16:38 630<html> <head> <t ... -
js实现javaMap对象
2013-08-22 08:38 524<script> /*js实现map功能*/ f ... -
input中的事件及方法
2013-07-18 16:50 0input text 的事件及方法 ... -
js循环删除表格
2013-06-07 10:37 691由于表格的总条数会随着表格的删除动态改变,因此不能使用传统的f ... -
web.xm文件的作用
2013-03-18 12:11 772web工程中的web.xml文件有 ... -
myeclipse修改cvs链接地址
2013-02-18 10:23 2237由于服务器IP的地址的变更,在eclipse中要进行更改仓库的 ... -
模态窗口使用介绍
2013-01-06 15:46 572打开模态窗口 window.showModalDialog(u ... -
js操作表格的方法介绍
2012-12-07 13:44 942在web开发中使用js动态生成表格的情况非常普遍,现对常用的方 ... -
js设置DIV属性
2012-12-05 08:42 662//控制内容 function settex ... -
document.getElementsByTagName()方法摘要
2012-09-07 18:01 635document.getElementsByTagName() ... -
设计select语句时影响效率查询的15个情况
2012-08-27 16:20 818没有创建索引,或者没有正确使用索引; 存在死锁的情况,从而导 ... -
web.xml配置文件详解
2011-12-26 11:15 5801 定义头和根元素 ... -
struts2文件上传最大值配置
2011-12-02 16:58 629使用Struts2的文件上传控 ...
相关推荐
centos6.5 monit 监控 性能 程序自动化监控
用于监控管理linux系统内进程、文件、服务等内容的程序,且提供web可视化界面。
Linux项目是一个开放源代码的操作系统项目,由林纳斯·托瓦兹(Linus Torvalds)于1991年首次发布。该项目以Linux内核为核心,围绕其构建了一个完整的操作系统,包括各种系统工具、库、应用程序和硬件支持。 以下是...
Linux系统具有高效的网络功能和稳定的性能,因此被广泛应用于服务器领域,Linux是云计算的核心组成部分,被广泛用于构建云平台和云服务。许多知名的云计算服务提供商都采用Linux系统作为其基础架构,一些游戏平台和...
Monit是unix系统上用于管理监视进程、文件、目录及设备的工具。Monit提供自动维护和修复功能,并能在出错时执行相应的关联的行为。比如monit可以开启一个进程(当它没有正常运行),重启一个进程(如果它没有反应)...
监控面板 描述 一目了然的Python Web应用程序可获取一堆服务器的仪表板。 屏幕截图 每个Monit服务器未找到警报时的主视图: 一个Monit代理正在报告服务器上的错误: 展开服务器,上面有错误的问题: 它是如何...
如何在centos上搭建monit监控linux服务器资源
邮件信息可能是邮件简报、状态更新(如Cachet)、监控警报(如Monit)、磁盘时间(如RAIDmdadm)等等。当你要建立自己的邮件发送服务器传递信息时,你可以替代使用一个免费的公共SMTP服务器,从而避免遭受维护之苦。...
Linux下常用的系统监控软件有Nagios、Cacti、Zabbix、Monit等,这些开源的软件,可以帮助我们更好的管理机器,在第一时间内发现,并警告系统维护人员