【发布时间】:2012-07-10 19:45:57
【问题描述】:
我正在尝试使用 nagios 和 nrpe 插件监视 Rails 应用程序的内部,但只得到 NRPE: Unable to read output
这是我的监控机器代码“check_test.rb”脚本:
#!/usr/bin/env ruby
# load rails
RAILS_ENV = 'production'
require '/var/www/production/current/config/environment'
error = 0
print "OK"
exit error # exit with the error code that is then interpreted by nagios
这是我的监控主机调用:
$ sudo /usr/local/nagios/libexec/check_nrpe -H remote.machine.com -c check_test -t 240
如果我删除下面的行,它可以正常工作:
# load rails
RAILS_ENV = 'production'
require '/var/www/production/current/config/environment'
任何帮助都会非常感激。 提前致谢。
【问题讨论】:
标签: ruby-on-rails ruby monitoring nagios nrpe