Skip to content

Commit

Permalink
Add read_timeout to http source to handle case of big list of nodes (#…
Browse files Browse the repository at this point in the history
…2236)

Co-authored-by: Nabil Gergis <nabil.gergis@bell.ca>
  • Loading branch information
ngergis and Nabil Gergis committed Nov 30, 2021
1 parent 4ed0fd7 commit 3089cff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Added

- Extend http source configurations to include read_timeout value
- enterasys800 model for enterasys 800-series fe/ge switches (@javichumellamo)
- add ES3526XA-V2 support in EdgeCOS model (@moisseev)
- model for eltex mes-series switches (@glaubway)
Expand Down
1 change: 1 addition & 0 deletions docs/Sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ source:
delimiter: !ruby/regexp /:/
user: username
pass: password
read_timeout: 120
map:
name: hostname
model: os
Expand Down
5 changes: 5 additions & 0 deletions lib/oxidized/source/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def read_http(node_want)
http.use_ssl = true if uri.scheme == 'https'
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @cfg.secure

# Add read_timeout to handle case of big list of nodes (default value is 60 seconds)
if @cfg.has_key? "read_timeout"
http.read_timeout = Integer(@cfg.read_timeout)
end

# map headers
headers = {}
@cfg.headers.each do |header, value|
Expand Down

0 comments on commit 3089cff

Please sign in to comment.