56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/nagios/splunk/cli.rb', line 56
def run(argv = ARGV)
parse_options(argv)
client = RestClient.new(config[:server_url])
splunk = Check.new(client)
begin
if config[:replication_factor]
status, message = splunk.cluster_replication_factor
elsif config[:search_factor]
status, message = splunk.cluster_search_factor
elsif config[:cluster_bundle_status]
status, message = splunk.cluster_bundle_status
elsif config[:localslave]
status, message = splunk.localslave(config[:warn], config[:crit])
elsif config[:pool]
status, message = splunk.pool_usage(config[:pool], config[:warn], config[:crit])
else
status, message = splunk.license_usage(config[:warn], config[:crit], config[:stack_id])
end
rescue Nagios::Splunk::Exception => e
message = e.message
status = 3
end
puts message
status
end
|