Class: Nagios::Splunk::Splunk
- Inherits:
-
Object
- Object
- Nagios::Splunk::Splunk
- Defined in:
- lib/nagios/splunk/splunk.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #cluster_master_generation ⇒ Object
- #cluster_master_info ⇒ Object
-
#initialize(client) ⇒ Splunk
constructor
A new instance of Splunk.
Constructor Details
#initialize(client) ⇒ Splunk
Returns a new instance of Splunk.
7 8 9 |
# File 'lib/nagios/splunk/splunk.rb', line 7 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/nagios/splunk/splunk.rb', line 5 def client @client end |
Instance Method Details
#cluster_master_generation ⇒ Object
16 17 18 19 |
# File 'lib/nagios/splunk/splunk.rb', line 16 def cluster_master_generation response = @client.get("/services/cluster/master/generation") Nokogiri::Slop(response.body) if response.code.to_i == 200 end |
#cluster_master_info ⇒ Object
11 12 13 14 |
# File 'lib/nagios/splunk/splunk.rb', line 11 def cluster_master_info response = @client.get("/services/cluster/master/info") Nokogiri::Slop(response.body) if response.code.to_i == 200 end |