0
我试图监控Rails应用程序与nagios
和nrpe
插件的内部,但只获得NRPE: Unable to read output
要监控Rails应用程序的使用Nagios和NRPE,但只获得了内部“NRPE:无法读取输出”
这是我的监控机代码 “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'
任何帮助将非常appretiated。 在此先感谢。
另一种选择是:'cd/var/www/production/current/&& script/rails runner -e [ENVIRONMENT]'YOUR_CLASS.YOUR_METHOD'' – pisaruk 2012-07-11 23:05:01