我注意到偶尔amavis没有运行。 我以为monit正在观察这个过程,但它似乎并没有警告我或修复它。 我的monitrc条目看起来像这样,我可以确认启动/停止monit作品的过程: check process amavisd with pidfile /var/run/amavis/amavisd.pid group mail start program = "/etc/init.d/amavis start" stop program = "/etc/init.d/amavis stop" if failed port 10024 protocol smtp then restart if 5 restarts within 5 cycles then timeout depends on amavisd_bin depends on amavisd_rc check file amavisd_bin with path /usr/sbin/amavisd-new group mail if failed checksum then […]
我正在尝试使用monit来查找运行时间过长的surefire进程并杀死它们。 机器正在并行运行,因此可以同时运行多个surefire进程,但是这些进程没有PID文件。 我的监视configuration如下所示: check process surefire matching "surefire/surefirebooter" if uptime > 4 hours then alert if uptime > 4 hours then stop 警报已发送,但停止不起作用。 我不能使用killall,因为这个过程是由java运行的,还有几个其他的java进程正在运行。 我所需要的就是检测该过程的正确PID,以便我可以杀死正确的PID。
我正试图在自动缩放的机器组上安装Monit。 理想情况下,我希望monit发送警报给我的nagios服务(已经configuration为升级警报)。 我find了这个要求这个function的旧post ,但是我找不到任何描述这个function的文档。 是否有可能在Monit中设置自定义警报? 最好的祝福 编辑:我知道我可以写一个bash脚本发送被动检查到Nagios,并执行一个exec命令,但我想知道是否有一个更干净的解决scheme,使用alert命令。
我在成功执行脚本时遇到了问题。 ~/.monitrc : check host example.com with address example.com if failed url http://example.com/startpage and content == "mainBaner" timeout 10 seconds then exec "/usr/local/bin/monit_example_error.sh" else if succeeded then exec "/usr/local/bin/monit_example_ok.sh" 如果出现错误,它似乎运行脚本,但在没有错误的情况下则不会。 日志显示testing运行并成功,/ /var/log/monit.log /log/ /var/log/monit.log : [CEST Jun 8 12:24:52] debug : 'example.com' succeeded testing protocol [HTTP] at INET[example.com:80/startpage] via TCP [CEST Jun 8 12:25:22] debug […]
我正在尝试创build一个简单的shell脚本来监视我的服务器。 我计划build立一个CRON工作,每5或10分钟运行一次。 这是如何工作的: 运行一些linux命令,例如iostat,mpstat,top等,并将结果输出到一个文本文件 通过CURL将文本文件发送到将接收文本文件并处理数据的URL,然后将重要指标发布到数据库 我打算使用这些数据来确定何时需要升级我的服务器。 但是,我没有太多的服务器监控经验,所以我不知道我应该寻找什么样的门槛。 例如,当我运行像mpstat -P ALL类的东西时,什么样的数字会让我感到困扰? 还是iostat ? 我只是希望能够有一些参考点来了解我的服务器何时处于良好状态,即负载是否合理,状态是否过载,以及是否需要升级或负载平衡。 提前致谢。
我是Linux新手,我在Digital Ocean上安装了Ubuntu 12.04。 我安装了Monit,并通过电子邮件警报成功监控了MySQL。 我也想监视Apache2,但是找不到需要放入monitrc文件的任何httpd.pid文件。 我可以启动Apache2: /etc/init.d/apache2 start 我可以用: /etc/init.d/apache2 stop来停止Apache2 我可以重新启动Spache2: /etc/init.d/apache2 restart 在没有httpd.pid文件的情况下,还有什么其他方法可以监视Monit中的Apache2?
我的域名使用谷歌应用程序电子邮件为其电子邮件托pipe 我想知道是否有某种方式连接到我的UNIX服务器的谷歌电子邮件,以便我可以通过该谷歌应用程序帐户发送邮件。 例如,monit(服务器监控软件包)将使用“set mailserver localhost”将邮件发送到本地系统有没有一种方法可以让我用google应用程序中的某个地址replacelocalhost?
我目前正在试图find实现这种傀儡粒度的“最佳方法”:我有一台在testing环境中运行memcached的服务器,另一台运行在生产环境中的服务器。 这些服务器使用不同的memcached选项运行,我使用monit监视并在需要时重新启动它们,monit通过puppetpipe理,它通过memcached.monitrc监视memcached,直到如此。 我的问题是:我有一个名为“monit :: monitor”的定义资源,它接收一个名称获取该资源的模板,如 monit::monitor { 'memcached': } 这是monit :: monitor的代码: define monit::monitor($template_params = {}) { file { "/etc/monit/monit.d/${name}.monitrc": ensure => present, content => template("monit/${name}.monitrc.erb"), } } 这将在modules / monit / templates目录中查找“memached.monitrc.erb”并将其打印出来,但是在那个文件中,我需要为memcached参数化内存参数,如果它在testing环境中运行,应该是64m,if生产3072m。 templates / memcached.monitrc.erb看起来像这样 check process memcached with pidfile /var/run/memcached0.pid start program = "/usr/bin/memcached -d -p 11211 -U 11211 -u memcached -m <%= […]
我如何创build一个用于监视C程序的pid文件,以及如何使用监视监视该C程序?
我已经在CentOS 6.5上安装了一个monit 。 事件正在被检测到,并且警报邮件正在发送,但是当事件触发时,通过exec特性,我试图让其他事情发生,而这些都不起作用。 例如,我有一个像这样的规则: if cpu usage (user) > 10% then exec "/bin/echo 'user limit' >> /tmp/monit-status-log" as uid someuser and gid somegroup 该规则在CPU负载下适当触发,但没有任何内容写入文件(其保护设置为rw-rw-rw)。 执行的日志文件看起来是正确的,我猜: [PST Feb 20 09:31:04] info : 'linux2.example.com' Monit reloaded [PST Feb 20 09:31:31] info : Reinitializing monit daemon [PST Feb 20 09:31:31] info : Awakened by the SIGHUP signal […]