Skip to content

Commit

Permalink
Fix output
Browse files Browse the repository at this point in the history
From #15
  • Loading branch information
eheydrick committed May 24, 2016
1 parent 3431fff commit f6345ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)

## [Unreleased]
### Fixed
- check-redis-memory.rb, check-redis-memory-percentage.rb: fix message output

## [0.1.0] - 2016-03-22
### Added
Expand Down
4 changes: 2 additions & 2 deletions bin/check-redis-memory-percentage.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def run
if used_memory >= crit_memory
critical "Redis running on #{config[:host]}:#{config[:port]} is above the CRITICAL limit: #{used_memory}% used / #{crit_memory}%"
elsif used_memory >= warn_memory
warning "Redis running on #{config[:host]}:#{config[:port]} is above the WARNING limit: #{used_memory} % used / #{warn_memory}%"
warning "Redis running on #{config[:host]}:#{config[:port]} is above the WARNING limit: #{used_memory}% used / #{warn_memory}%"
else
ok "Redis memory usage: #{used_memory} is below defined limits"
ok "Redis memory usage: #{used_memory}% is below defined limits"
end
rescue
message = "Could not connect to Redis server on #{config[:host]}:#{config[:port]}"
Expand Down
6 changes: 3 additions & 3 deletions bin/check-redis-memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def run
warn_memory = config[:warn_mem]
crit_memory = config[:crit_mem]
if used_memory >= crit_memory
critical "Redis running on #{config[:host]}:#{config[:port]} is above the CRITICAL limit: #{used_memory} KB used / #{crit_memory} KB limit"
critical "Redis running on #{config[:host]}:#{config[:port]} is above the CRITICAL limit: #{used_memory}KB used / #{crit_memory}KB limit"
elsif used_memory >= warn_memory
warning "Redis running on #{config[:host]}:#{config[:port]} is above the WARNING limit: #{used_memory} KB used / #{warn_memory} KB limit"
warning "Redis running on #{config[:host]}:#{config[:port]} is above the WARNING limit: #{used_memory}KB used / #{warn_memory}KB limit"
else
ok 'Redis memory usage is below defined limits'
ok "Redis memory usage: #{used_memory}KB is below defined limits"
end
rescue
message = "Could not connect to Redis server on #{config[:host]}:#{config[:port]}"
Expand Down

0 comments on commit f6345ac

Please sign in to comment.