diff options
author | Antoine GUEVARA <antoine.guevara@recia.fr> | 2015-06-24 16:29:12 +0200 |
---|---|---|
committer | Antoine GUEVARA <antoine.guevara@recia.fr> | 2015-06-24 16:29:12 +0200 |
commit | 99261121f25ac55f502436a0ace345b02e4a387a (patch) | |
tree | 9fb3715587ee4cff9b082eaa01c33f1769065916 /extra | |
parent | 9c3aa94f415503ab238b8ceed7c36f80b9e986ca (diff) |
Updated nagios_check_failing_nodes.rb
Diffstat (limited to 'extra')
-rw-r--r-- | extra/nagios_check_failing_nodes.rb | 8 |
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 |