Class: Nagios::Splunk::Splunk

Inherits:
Object
  • Object
show all
Defined in:
lib/nagios/splunk/splunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject

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_generationObject



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_infoObject



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