Sha256: 28f8a66dd1b34c83f140b87788965c511f98fb08877597aadb109c619de85bc9

Contents?: true

Size: 716 Bytes

Versions: 26

Compression:

Stored size: 716 Bytes

Contents

#!/usr/bin/env ruby

## contrib via https://github.com/ytti/oxidized/issues/67

require 'open-uri'
require 'json'

critical = false
pending = false
critical_nodes = []
pending_nodes = []

json = JSON.load(open("http://localhost:8888/nodes.json"))
json.each do |node|
  if not node['last'].nil?
    if node['last']['status'] != 'success'
      critical_nodes << node['name']
      critical = true
    end
  else
    pending_nodes << node['name']
    pending = true
  end
end

if critical
  puts '[CRIT] Unable to backup: ' + critical_nodes.join(',')
  exit 2
elsif pending
  puts '[WARN] Pending backup: ' + pending_nodes.join(',')
  exit 1
else
  puts '[OK] Backup of all nodes completed successfully.'
  exit 0
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
oxidized-0.25.1 extra/nagios_check_failing_nodes.rb
oxidized-0.25.0 extra/nagios_check_failing_nodes.rb
oxidized-0.24.0 extra/nagios_check_failing_nodes.rb
oxidized-0.23.0 extra/nagios_check_failing_nodes.rb
oxidized-0.22.0 extra/nagios_check_failing_nodes.rb
oxidized-0.21.0 extra/nagios_check_failing_nodes.rb
oxidized-0.20.0 extra/nagios_check_failing_nodes.rb
oxidized-0.19.0 extra/nagios_check_failing_nodes.rb
oxidized-0.18.0 extra/nagios_check_failing_nodes.rb
oxidized-0.17.0 extra/nagios_check_failing_nodes.rb
oxidized-0.16.3 extra/nagios_check_failing_nodes.rb
oxidized-0.16.2 extra/nagios_check_failing_nodes.rb
oxidized-0.16.1 extra/nagios_check_failing_nodes.rb
oxidized-0.16.0 extra/nagios_check_failing_nodes.rb
oxidized-0.15.0 extra/nagios_check_failing_nodes.rb
oxidized-0.14.3 extra/nagios_check_failing_nodes.rb
oxidized-0.14.2 extra/nagios_check_failing_nodes.rb
oxidized-0.14.1 extra/nagios_check_failing_nodes.rb
oxidized-0.14.0 extra/nagios_check_failing_nodes.rb
oxidized-0.13.1 extra/nagios_check_failing_nodes.rb