monit

running delayed_job under monit with ubuntu

六月ゝ 毕业季﹏ 提交于 2019-12-10 11:23:04
问题 I'm struggling to get delayed_job working under rails 3.0.9 (ruby 1.9.2). The only way I have succeeded to run is to tape manualy the command rake jobs:work. But I want that to be automatically started when the rails application is starting. I have installed monit under ubuntu and I configured it to launch a file located in my app. This fails looks like: check process delayed_job with pidfile /home/me/myapp/tmp/pids/delayed_job.pid start program = "/home/me/myapp/script/delayed_job start"

Make monit mail-format send top as well

五迷三道 提交于 2019-12-08 08:41:11
问题 I'm using monit to monitor some services. However, I want to get an email which includes the output from top when this happens. Is there some way to get this information? 回答1: Don't know if you can get it from the mail-format (which would be pretty nice) but they have the following example in the monit wiki: check file myfile with path /tmp/foo.bar if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'" 来源: https://stackoverflow.com/questions/31513996/make-monit

Monit fails to start process

我的未来我决定 提交于 2019-12-07 21:40:31
问题 I've written a scrip that works fine to start and stop a server. #!/bin/bash PID_FILE='/var/run/rserve.pid' start() { touch $PID_FILE eval "/usr/bin/R CMD Rserve" PID=$(ps aux | grep Rserve | grep -v grep | awk '{print $2}') echo "Starting Rserve with PID $PID" echo $PID > $PID_FILE } stop () { pkill Rserve rm $PID_FILE echo "Stopping Rserve" } case $1 in start) start ;; stop) stop ;; *) echo "usage: rserve {start|stop}" ;; esac exit 0 If I start it by running rserve start and then start

使用monit搭建一个监控系统

会有一股神秘感。 提交于 2019-12-07 20:56:35
使用monit搭建一个监控系统 北京马哥教育 发表于 北京马哥教育 订阅 356 在这篇文章中: 马哥linux运维 | 最专业的linux培训机构 1 监控进程 2 监控文件系统或者监控设备 3 监控文件 4 监控program 5 监控主机 马哥linux运维 | 最专业的linux培训机构 上周用monit搭建或者说定制了一个监控系统,来监控服务器发生事情。当然了主要是监控异常,因为我们的产品属于服务器类型,很多进程都daemon,要不停的运行。我们搭建监控目的不过是出现问题能够及时的知道,平时可从web UI上看到整个系统的状况,同时它本身要轻量级,不要影响性能。当然了类似的产品很多了,比如Ganglia,我在老科长波哥曾经搭建过一个Ganglia系统监控科室十几台服务器,让我很是崇拜。本文重点介绍monit。 monit是一个可以监控系统,进程,文件系统,目录,设备的监控软件,可以自动唤起那些异常退出的进程,还可定制你想监控的东西。同时monit提供了内置的WEB UI的功能,可以一目了然地了解监控项的情况。其中正常项为绿色,异常项为红色,很方便的告警,另外,monit还提供了发邮件通知的功能,对于紧急的异常情况可以发送邮件到指定邮箱。比如发生了coredump,发生了DB corrupt,daemon进程异常重启,可以第一时间邮件通知到管理员,呵呵很强大吧

monit insists on timing out a program that's running fine

限于喜欢 提交于 2019-12-07 19:09:33
问题 I'm having a problem monitoring a program using monit. I'm running this on a raspberry pi, having built monit 5.11 from source; I tried using the version from the repositories, but it was 5.4 and didn't support some of syntax below that I want. I'm trying to follow the "Q: I have a program that does not create its own pid file. Since monit requires all programs to have a pid file, what do I do?" entry in the FAQ. Here's my start_sensors.sh script (which just runs my python program, instead of

如何使用Monit部署服务器监控系统

柔情痞子 提交于 2019-12-07 14:30:34
如何使用Monit部署服务器监控系统 2018年08月14日 15:58:12 hakula007 阅读数:298 很多Linux系统管理员依赖一个集中式的远程监控系统(比如Nagios或者Cacti)来检查他们网络基础设备的健康状况。虽然集中式监控让管理员的生活更简单了,然而处理很多机器和服务时,专用的监控中心显然成为了一个单点故障,如果监控中心挂了或者因为什么原因(比如硬件或者网络故障)不可访问了,你就会失去整个网络基础设备情况的任何信息。 一个给你的监控系统增加冗余度的方法是安装独立的监控软件(作为后备),至少在网络中的关键/核心服务器上。这样在集中式监控系统挂掉的情况,你还有能力通过后备的监控方式来获取核心服务器的运行状况。 Monit是什么? Monit 是一个跨平台的用来监控Unix/linux系统(比如Linux、BSD、OSX、Solaris)的工具。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。然而,Monit可以胜任全面监控、进程状态监控、文件系统变动监控、邮件通知和对核心服务的自定义动作等场景。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。 我已经在一些机器使用Monit几年了,而且我对它的可靠性非常满意。甚至作为全面的监控系统

[译] 如何使用Monit部署服务器监控系统

ぐ巨炮叔叔 提交于 2019-12-07 11:31:31
[译] 如何使用Monit部署服务器监控系统 linux linux运维 监控 主机监控 5.3k 次阅读 · 读完需要 26 分钟 7 很多Linux系统管理员依赖一个集中式的远程监控系统(比如 Nagios 或者 Cacti )来检查他们网络基础设备的健康状况。虽然集中式监控让管理员的生活更简单了,然而处理很多机器和服务时,专用的监控中心显然成为了一个单点故障,如果监控中心挂了或者因为什么原因(比如硬件或者网络故障)不可访问了,你就会失去整个网络基础设备情况的任何信息。 一个给你的监控系统增加冗余度的方法是安装独立的监控软件(作为后备),至少在网络中的关键/核心服务器上。这样在集中式监控系统挂掉的情况,你还有能力通过后备的监控方式来获取核心服务器的运行状况。 Monit是什么? Monit 是一个跨平台的用来监控Unix/linux系统(比如Linux、BSD、OSX、Solaris)的工具。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。然而,Monit可以胜任全面监控、进程状态监控、文件系统变动监控、邮件通知和对核心服务的自定义动作等场景。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。 我已经在一些机器使用Monit几年了,而且我对它的可靠性非常满意。甚至作为全面的监控系统

Monit Ruby on Rails Sidekiq

∥☆過路亽.° 提交于 2019-12-07 02:23:07
问题 I'm trying to set up Monit for Sidekiq. Here's what I have so far for my config file: check process sidekiq_site with pidfile /var/www/site/tmp/pids/sidekiq.pid start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory? group site_sidekiq The problem is I'm getting a message when I run monit reload that the program "bundle" does not

monit设置邮件频率和短信警报

六月ゝ 毕业季﹏ 提交于 2019-12-07 00:04:03
monit设置邮件频率和短信警报 June 3, 2013 一、monit 配置邮件发送频率 1.1 增加心跳周期 默认为60s 改为120s,可适当在增加 set daemon 120 1.2 增加进程检测周期 将默认的: check system 192.168.16.204 if loadavg (1min) > 6 if loadavg (5min) > 4 if memory usage > 95% if swap usage > 95% if cpu usage (user) > 95% if cpu usage (system) > 95% if cpu usage (wait) > 95% 改为如果三次(或更多)都达到警报条件则报警 check system 192.168.16.204 if loadavg (1min) > 6 for 3 cycles then alert if loadavg (5min) > 4 for 3 cycles then alert if memory usage > 95% for 3 cycles then alert if swap usage > 95% for 3 cycles then alert if cpu usage (user) > 95% for 3 cycles then alert if cpu

Running monit as a restricted user and making it watch a process that needs root privileges

旧街凉风 提交于 2019-12-06 10:33:08
问题 I have a specific script written in Ruby that needs root privileges. Most of the other processes don't need that and so were easy to setup in Monit. Not this one. The server needs to listen at 386, and this port is only available for root. I won't get into the details of why, because 1) I'm not a low-level kind of guy, 2) It worked fine so far when using sudo. The monit configuration file is simple and looks like this: set logfile syslog facility LOG_daemon # Default facility is LOG_USER set