I'm trying to monitor the internals of a rails application with nagios
and nrpe
plugin but only getting NRPE: Unable to read output
Here is my Monitoring Machine Code "check_test.rb" script:
#!/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
Here is my Monitoring Host call:
$ sudo /usr/local/nagios/libexec/check_nrpe -H remote.machine.com -c check_test -t 240
If I remove the lines below, it works fine:
# load rails
RAILS_ENV = 'production'
require '/var/www/production/current/config/environment'
Any help will be very much appretiated. Thanks in advance.