summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/nagios_check_failing_nodes.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/extra/nagios_check_failing_nodes.rb b/extra/nagios_check_failing_nodes.rb
index 1c81f66..4436b1c 100644
--- a/extra/nagios_check_failing_nodes.rb
+++ b/extra/nagios_check_failing_nodes.rb
@@ -10,9 +10,11 @@ critical_nodes = []
json = JSON.load(open("http://localhost:8888/nodes.json"))
json.each do |node|
- if node['last']['status'] != 'success'
- critical_nodes << node['name']
- critical = true
+ if not node['last'].nil?
+ if node['last']['status'] != 'success'
+ critical_nodes << node['name']
+ critical = true
+ end
end
end