summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/nagios_check_failing_nodes.rb8
-rw-r--r--lib/oxidized/node.rb3
2 files changed, 7 insertions, 4 deletions
diff --git a/extra/nagios_check_failing_nodes.rb b/extra/nagios_check_failing_nodes.rb
index 27a5c66..abb34ba 100644
--- a/extra/nagios_check_failing_nodes.rb
+++ b/extra/nagios_check_failing_nodes.rb
@@ -23,12 +23,12 @@ json.each do |node|
end
end
-if pending
- puts '[WARN] Pending backup: ' + pending_nodes.join(',')
- exit 1
-elsif critical
+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
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb
index d50317f..c847416 100644
--- a/lib/oxidized/node.rb
+++ b/lib/oxidized/node.rb
@@ -9,6 +9,9 @@ module Oxidized
attr_accessor :running, :user, :msg, :from, :stats, :retry
alias :running? :running
def initialize opt
+ if CFG.debug == true or opt[:debug] == true
+ puts 'resolving DNS for %s...' % opt[:name]
+ end
@name = opt[:name]
@ip = IPAddr.new(opt[:ip]).to_s rescue nil
@ip ||= Resolv.new.getaddress @name