"Monitor" method

newbie question here, I have a method that is not part of the "user"
part of the rails app, but more like a monitor method that should live
on a separate process from the rails process, but it need access to
the rails env and dbs, should that method be a rake task or just a
method in a module in the /lib folder or something else ? are there
any conventions for this ?