开发者

Check Rails application with Nagios

开发者 https://www.devze.com 2023-03-14 23:35 出处:网络
I want to check my rails-website with a simple nagios URL check. The problem is, that on every GET request from Nagios (every minute), a new session will be inserted in the sessions table. How can I p

I want to check my rails-website with a simple nagios URL check. The problem is, that on every GET request from Nagios (every minute), a new session will be inserted in the sessions table. How can I prevent rails from generating new records for the Nag开发者_JAVA技巧ios queries?


I think the best way to approach this would be to create a NagiosController which does the testing you require. Just make sure that controller and its associated views never access the session object, and it never gets loaded

Of course, this might still create db records - not sure, haven't tested. 1 db insert a minute isn't going to kill the system though, and if you clear out sessions as per @eugen's comment aboe, you should be fine. I would think clearing them hourly would more than suffice.

edit: according to the ActionController::Base APIdoc, you could also call reset_session (at the end of your action, I guess), which "removes the entire session"

0

精彩评论

暂无评论...
验证码 换一张
取 消