Articles of monit

以检查为基础,以邮件格式覆盖monit警报

我目前有两个监视每个主机我运行HTTPS: check host www-example-https with address www.example.org if failed port 443 protocol https then alert check host www-example-certificate with address www.example.org every "25 10 * * *" if failed port 443 protocol https and certificate valid > 30 days then alert 第一个警告我连接失败,每2分钟运行一次,而第二个提醒我说,一个证书的有效期至less30天,只有一天运行一次。 目前,这两项检查都会导致类似的警报消息,这意味着即将到期的证书看起来像HTTPS完全失败。 因此,我想重写每个警报的默认邮件选项。 我知道如果我想要更改所有的警报,我可以用set mail-format来做到这一点,但是如果我使用了一个if failed … then alert的if failed … then alert我找不到单个警报的语法if failed […]

设置“监视”来监视服务,但无法加载

我试图让我的新服务器: https://mmonit.com/monit/ 我已经安装了它,但是当我尝试并运行任何命令时,它超时: root@mail:~# monit status /etc/monit/monitrc:298: Include failed — Success '/etc/monit/conf.d/*' /etc/monit/monitrc:299: Include failed — Success '/etc/monit/conf-enabled/*' Cannot create socket to [192.168.1.34]:2812 — Connection timed out 我在/ etc / monit / monitrc中的configuration有: set httpd port 2812 and use address 192.168.1.34 # only accept connection from localhost # allow localhost # allow localhost to connect […]

Monit在复位后不会接受httpd进程

我在运行CentOS 5的一台服务器上安装了Munin和Monit。除了重启httpd进程时,一切正常,logging和报告信息。 我有Monit设置为重新启动httpd,如果它达到2.5GB的内存使用量。 如果/发生这种情况,它会重新启动,但Monit不会拿起新的进程。 我会得到一个通知告诉我,httpd服务不存在,然后另一个告诉我httpd无法启动,然后最后一个说,httpd服务超时,不会再被监控。 我不知道为什么我得到这些报告,因为httpd服务重新启动就好了。 我已经检查了日志,没有重新启动的问题。

运行Postfix的W / O安全吗?

在生产服务器上安全运行之前,需要保护postfix吗? 我依靠Monit来通知我,如果某些进程停机或遇到麻烦。 为了这个目的,只有这个目的,我需要在服务器上的后缀,以便Monit可以给我发送电子邮件通知。 如果在部署Postfix之前有必要确保安全,那么我可以采取哪些步骤来使安全性更高?

在操作系统升级到Ubuntu 10.04 LTS之后,Monit不会启动

Iv最近将Ubuntu的版本从9.04升级到了10.04LTS(通过9.10),现在Monit不会启动。 做一个sudo /etc/init.d/monit syntax说,语法是好的。 如果我运行命令sudo /etc/init.d/monit start我得到Starting daemon monitor: monit 。 但是,如果我做一个ps -ef ,那么monit不会被列出。 如果我深入了解/etc/init.d/monit文件,那么我可以看到运行的可执行文件是/etc/monit/monitrc 。 用sudo运行这个输出 /etc/monit/monitrc: 6: allow: not found /etc/monit/monitrc: 7: SSL: not found /etc/monit/monitrc: 8: PEMFILE: not found /etc/monit/monitrc: 10: check: not found /etc/monit/monitrc: 11: Syntax error: word unexpected (expecting ")") 我的控制文件如下: set mailserver localhost set mail-format { from: [email protected] } […]

简化monitrc(使其干燥)

我所看到的大多数monitrc示例都是冗长的,大量重复的5-10行样板检查。 有什么办法参数化这个东西吗? 我想要的东西是: ensure_rails 8080 ensure_php 8081 ensure_mysql 10000 可以和Monit一起使用吗?

使用monit重启自定义守护进程

我使用系统守护进程pear类写了一个php守护进程。 如何使用monit在失败时重新启动它? 我在我的监视configuration文件中有以下代码: check process merge with pidfile /var/www/merge/merge.pid group 1000 start program = "/etc/init.d/merge start" stop program = "/etc/init.d/merge stop" IF CHANGED PID then restart 我的目标是,如果守护进程失败(由于错误而停止运行),我想让它重新开始运行。

Monit不重新启动服务

我有一个node.js脚本,我想在一个Funtoo系统上进行守护进程(我标记为Gentoo,因为我不认为在这里比Gentoo有什么特别的Funtoo),我用下面的init脚本来做这个: #!/sbin/runscript depend(){ need redis } start(){ ebegin "Starting myapp" NODE_ENV="prod" start-stop-daemon –start –background –make-pidfile -1 /var/log/myapp.log -2 /var/log/myapp.error –chdir /opt/myapp –pidfile /var/run/myapp.pid –exec /usr/bin/node — /opt/myapp/myapp.js eend $? } stop(){ ebegin "Stopping myapp" start-stop-daemon –stop –pidfile /var/run/myapp.pid –exec /usr/bin/node — /opt/myapp/myapp.js eend $? } 有了这个,我可以使用init脚本或rc-service来启动和停止服务。 然后,为了确保它在出现错误时保持运行状态,我使用下列configuration的monit: check process myapp with pidfile "/var/run/myapp.pid" start program […]

从埃佩尔Monit不能通过新贵的方法启动

我有centos 6.3机器,做了一个yum安装monit(epel的版本monit 5.1.1-4.el6),然后我安装了http://mmonit.com/wiki/Monit/Upstart并试图启动monit initctl启动monit initctl:作业启动失败。 我在另一台机器上下载了monit-5.3.2-2.el6.rf.x86_64.rpm的.rpm文件,并做了相同的工作,并能够通过initctl方法启动。 epel版本中可能会丢失什么?

Monit和清漆

我正在使用下面的configurationmonit set daemon 30 check process varnish with pidfile /var/run/varnishd.pid if failed host www.hatchedbyyolk.com port 80 protocol http and request "/monit-check-url" then exec "/root/scripts/varnish_restart.sh" set httpd port 2812 and use address localhost allow localhost monit开始就好,但monit status显示如下 Process 'varnish' status Does not exist monitoring status monitored data collected Sun Oct 13 00:37:03 2013 由于某些未知的原因,启动和停止命令对清漆没有影响,所以我使用/root/scripts/varnish_restart.sh这个脚本 #! /bin/sh […]