prtg 0.0.1p3 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/prtg/client.rb CHANGED
@@ -45,8 +45,7 @@ module Prtg # :nodoc:
45
45
  end
46
46
 
47
47
  def getstatus
48
- url_params = Utils.url_params(auth_params)
49
- parse_response(host.get("/api/getstatus.xml" + url_params))
48
+ host.get("/api/getstatus.xml")
50
49
  end
51
50
 
52
51
  def devices
@@ -81,27 +80,12 @@ module Prtg # :nodoc:
81
80
  end
82
81
 
83
82
  def api_request(params)
84
- url_params = Utils.url_params(auth_params.merge(params))
85
- response = host.get("/api/table.xml?" + url_params)
86
-
87
- parse_response(response)
83
+ resp_body = host.get("/api/table.xml?" + Utils.url_params(auth_params.merge(params))).body
84
+ XmlSimple.xml_in(resp_body)
88
85
  end
89
86
 
90
87
  def method_missing(*args)
91
88
  super(*args)
92
89
  end
93
-
94
- private
95
-
96
- def parse_response(response)
97
- hash = XmlSimple.xml_in(response.body)
98
-
99
- if hash["error"]
100
- raise hash["error"]
101
-
102
- else
103
- hash["item"]
104
- end
105
- end
106
90
  end
107
91
  end
data/lib/prtg/query.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require "prtg/sensor"
2
+
1
3
  module Prtg # :nodoc:
2
4
 
3
5
  # Proxy class to caspule request
@@ -19,7 +21,7 @@ module Prtg # :nodoc:
19
21
  # content is like a table
20
22
  # count is like LIMIT
21
23
  # start is like OFFSET
22
- VALUES = [:count, :start, :output, :objid]
24
+ VALUES = [:count, :start, :output, :id]
23
25
 
24
26
  VALUES.each do |key|
25
27
  define_method key do |value|
data/lib/prtg.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  # encoding: utf-8
2
- dir = File.dirname(__FILE__)
3
- $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
4
2
  require "rubygems"
5
- require "#{dir}/prtg/client"
6
- require "#{dir}/prtg/query"
7
- require "#{dir}/prtg/utils"
3
+ require "happymapper"
4
+
5
+ require "prtg/client"
6
+ require "prtg/query"
7
+ require "prtg/live_data_response"
8
+ require "prtg/utils"
8
9
 
9
10
  # This is a wrapper for the api of paessler's prtg monitoring tool.
10
11
  #
@@ -16,5 +17,5 @@ require "#{dir}/prtg/utils"
16
17
  # client = Prtg::Client.new(:host => http, :username => "foo", :password => "bar")
17
18
  # p client.live_data(:sensors)
18
19
  module Prtg
19
- VERSION = "0.0.1p3"
20
+ VERSION = "0.0.1"
20
21
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prtg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1p3
5
- prerelease: 5
4
+ version: 0.0.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Konstantin Kanellopoulos
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-30 00:00:00.000000000 Z
12
+ date: 2011-12-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-simple
16
- requirement: &21831180 !ruby/object:Gem::Requirement
16
+ requirement: &70336738101360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *21831180
24
+ version_requirements: *70336738101360
25
25
  description: This gem is a wrapper around the prth http api.Prtg is an network monitoring
26
26
  solution which provides a api to retrieve several information about monitored devices.
27
27
  email: k@kanello.de
@@ -29,9 +29,9 @@ executables: []
29
29
  extensions: []
30
30
  extra_rdoc_files: []
31
31
  files:
32
- - lib/prtg/utils.rb
33
- - lib/prtg/query.rb
34
32
  - lib/prtg/client.rb
33
+ - lib/prtg/query.rb
34
+ - lib/prtg/utils.rb
35
35
  - lib/prtg.rb
36
36
  homepage: http://github.com/ikaros/Prtg-for-Ruby
37
37
  licenses: []
@@ -44,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.8.7
47
+ version: 1.9.2
48
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
@@ -58,4 +58,3 @@ signing_key:
58
58
  specification_version: 3
59
59
  summary: Wrapper for the prtg network monitor api (http://www.paessler.com/prtg)
60
60
  test_files: []
61
- has_rdoc: