Skip to content

Commit

Permalink
Don't try to parse dates that aren't available (N/A)
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles committed Apr 22, 2011
1 parent 8dd0240 commit cc29583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/nagiosharder.rb
Expand Up @@ -323,7 +323,9 @@ def parse_status_html(response)
end

status = columns[2].inner_html if columns[2]
last_check = if columns[3]
last_check = if columns[3] && columns[3].inner_html != 'N/A'
last_check_str = columns[3].inner_html

DateTime.strptime(columns[3].inner_html, nagios_time_format).to_time
end
duration = columns[4].inner_html.squeeze(' ').gsub(/^ /, '') if columns[4]
Expand Down

0 comments on commit cc29583

Please sign in to comment.