We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following is a small script which we wrote to add failing oxidized nodes to our monitoring system. Might be worth to include it.
#!/usr/bin/env ruby require 'open-uri' require 'json' critical = false critical_nodes = [] json = JSON.load(open("http://localhost:8888/nodes.json")) json.each do |node| last = node['last'] if node['last']['status'] != 'success' critical_nodes << node['name'] critical = true end end if critical puts 'Unable to backup: ' + critical_nodes.join(' ') exit 2 else puts 'Backup of all nodes completed successfully.' exit 0 end
The text was updated successfully, but these errors were encountered:
5fe82dc
Hi all, I've made some adjustments to this script, I hope this could help :
#!/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 = [] begin json = JSON.parse(open("http://localhost:8888/nodes.json").read) rescue puts '[CRIT] Unable to connect' exit 2 end 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
Sorry, something went wrong.
No branches or pull requests
The following is a small script which we wrote to add failing oxidized nodes to our monitoring system. Might be worth to include it.
The text was updated successfully, but these errors were encountered: