Class: Diskmon::Collector
- Inherits:
-
Object
- Object
- Diskmon::Collector
- Defined in:
- lib/diskmon/collector.rb
Instance Method Summary collapse
Instance Method Details
#send_report(url, login, password, dump) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/diskmon/collector.rb', line 7 def send_report(url, login, password, dump) c_uri = URI(url) p c_uri if $DEBUG c_req = Net::HTTP::Post.new(c_uri.path) c_req.basic_auth(login, password) c_req.body = dump c_req.content_type = 'text/plain' res = Net::HTTP.start(c_uri.host, c_uri.port) do |http| http.request(c_req) end res.code end |