From 99261121f25ac55f502436a0ace345b02e4a387a Mon Sep 17 00:00:00 2001 From: Antoine GUEVARA Date: Wed, 24 Jun 2015 16:29:12 +0200 Subject: Updated nagios_check_failing_nodes.rb --- extra/nagios_check_failing_nodes.rb | 8 +++++--- 1 file 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 -- cgit v1.2.1