- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经安装并(希望)配置了 Monit,在 /etc/monit.d
中创建了一个新任务(在 CentOS 6.5 上)
我的任务文件名为test
:
check host test with address 127.0.0.1
start program = "/usr/local/bin/node /var/node/test/index.js" as uid node and gid node
stop program = "/usr/bin/pkill -f 'node /var/node/test/index.js'"
if failed port 7000 protocol HTTP
request /
with timeout 10 seconds
then restart
当我运行时:
service monit restart
在我的监控日志中出现:
[CEST Jul 4 09:50:43] info : monit daemon with pid [21946] killed
[CEST Jul 4 09:50:43] info : 'nsxxxxxx.ip-xxx-xxx-xxx.eu' Monit stopped
[CEST Jul 4 09:50:47] info : 'nsxxxxxx.ip-xxx-xxx-xxx.eu' Monit started
[CEST Jul 4 09:50:47] error : 'test' failed, cannot open a connection to INET[127.0.0.1:7000] via TCP
[CEST Jul 4 09:50:47] info : 'test' trying to restart
[CEST Jul 4 09:50:47] info : 'test' stop: /usr/bin/pkill
[CEST Jul 4 09:50:47] info : 'test' start: /usr/local/bin/node
如果我从命令行运行脚本,我不明白为什么该脚本不起作用:
su node # user created for node scripts
node /var/node/test/index.js
一切正常...
我关注了this tutorial .
如何解决这个问题?谢谢
最佳答案
同样的方法对我来说也不起作用,我所做的是制作一个启动/停止脚本,并将该脚本传递到monit中的启动程序
和停止程序
参数中。
您可以从 here 找到启动/停止脚本的示例
以下是我的 Node.js 应用程序的监控设置
check host my-node-app with address 127.0.0.1
start program = "/etc/init.d/my-node-app start"
stop program = "/etc/init.d/my-node-app stop"
if failed port 3002 protocol HTTP
request /
with timeout 5 seconds
then restart
if 5 restarts within 5 cycles then timeout
关于node.js - Monit 不启动 Node 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24569308/
我使用 monit 来监视服务的状态,当服务关闭时,我想以相同的格式向多个收件人发送警报电子邮件。这是我的监控配置的一部分: set mail-format { from: no-reply@gmai
我使用 monit 来监视服务的状态,当服务关闭时,我想以相同的格式向多个收件人发送警报电子邮件。这是我的监控配置的一部分: set mail-format { from: no-reply@gmai
我已经尝试了几个小时来配置 monit,以便我可以通过 Web 浏览器从 http://:2812 远程访问它,但它总是超时。我在 http::8081 上的同一个实例上运行 Nexus,因此我知道基
有什么方法可以停止接收有关重新加载“monit”服务的电子邮件吗? 这是/etc/monit.d/config 中的当前配置(mydomain.com 是我的机器): * check system m
我安装了monit并尝试使用以下命令检查状态。 monit status 但最终会出现以下错误。 monit: error connecting to the monit daemon 我该如何解决这
我要在 monitrc 中访问以下详细信息: set httpd port 2812 and use address localhost # only accept connection f
我在我的 ec2 实例上使用 monit 并且我是 nginx 的新手。下面是我的 nginx 配置文件: server { listen 80; server_name 127.0.0.1;
我已经使用monit了一段时间,但是我想警告文件是否存在。这是与the main documentation相反的用例。 这是医生说的: IF [DOES] NOT EXIST [[] CYCLES
我正在使用 Monit 来监控系统。我有一个我希望监控的 python 文件,我知道我需要创建一个包装脚本,因为 python 不会生成 pid 文件。我按照 site 上的说明进行操作,但是我一直无
我有一个通过通常的 init.d/service 脚本运行的守护进程。 我有 monit 运行,以确保这些守护进程在崩溃时重新启动。 我有一个请求,'service foo stop' 应该停止守护进
在 monit 配置文件中,我们有一个希望 monit 检查的进程列表。每一个看起来都像: check process process_name_here with pidfile /path/t
我在使用 monit 监视程序时遇到问题。 我在树莓派上运行它,从源代码构建了 monit 5.11;我尝试使用存储库中的版本,但它是 5.4,并且不支持下面我想要的一些语法。 我正在尝试遵循“问:我
我想尝试使用 monit 监控 postfix 队列。我从 Stackoverflow 的人那里举了一个例子。我的monit版本是最新的 这是 Monit 5.10 版 在 /etc/monit.d我
当我的服务器进入高负载时,Apache 的优雅重启似乎使事情恢复了控制。所以我使用以下配置设置了 monit: set daemon 10 check system localhost i
我写了一个可以很好地启动和停止服务器的脚本。 #!/bin/bash PID_FILE='/var/run/rserve.pid' start() { touch $PID_FILE
这是我的第一篇文章,请耐心等待! 我已经尝试创建脚本来检查服务是否无法访问(http 错误代码),然后 Monit 应该重新启动程序(预览服务)。 Monit 作为用户“spark”运行。 这是 ph
我已经使用 YUM 在我的 Centos 5.11 服务器(具有 Webmin/Virtualmin)上安装了 monit,一切似乎都正常。我发现它没有在启动时启动,因为当我尝试启动 monit 服务
我目前正在尝试监控我的系统证书,以确保在过期前 30 天收到警报。作为示例,我以 google.com 为例并监控其证书。查看 monitrc 文件,我添加了这个: check host google
Monit 无法正常启动redis-server。 通过 init.d 运行 Redis 工作正常: $ sudo su $ /etc/init.d/redis_6379 start $ #=> St
我正在调试 monit 启动/停止程序语句。在我的 /etc/monit.conf 文件中,我的 start program 语句如下所示: check process node with pidfi
我是一名优秀的程序员,十分优秀!