sensu-plugins-memory-checks 3.0.3 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/bin/check-memory-percent.sh +16 -8
- data/lib/sensu-plugins-memory-checks/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db85b632d9bdb38bc83d3c7b3083bd49592a1a14
|
4
|
+
data.tar.gz: 7fa43c23d1fa44bbd6c052c917e7824f96a1fd32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6396c87b11b9137b7929a8eb6e4527566801fec573795f6e61bf21e5ccfefb5cecdb889b8eac56473e385eabbdaf6014152c25fad6d645cc33ef171487fc5a13
|
7
|
+
data.tar.gz: ead6a65b68768c5b0f7740d27eccc43ecedca200af99e56013551510ef762abfd66234cdc3ce7fc6664f15bb0e87aca0e3a4ed9fa5a9d5935422b16e7add1553
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,15 @@ This CHANGELOG follows the located [here](https://github.com/sensu-plugins/commu
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [3.1.1] - 2017-10-25
|
9
|
+
### Fixed
|
10
|
+
- check-memory-percent.sh: compare variable `$os` rather than the string 'os' (@lcc207)
|
11
|
+
|
12
|
+
## [3.1.0] - 2017-10-20
|
13
|
+
### Added
|
14
|
+
- check-memory-percent.sh: added osx support (@jjdiazgarcia)
|
15
|
+
- check-memory-percent.sh: make if statement syntax consistent with the script (@majormoses)
|
16
|
+
|
8
17
|
## [3.0.3] - 2017-09-23
|
9
18
|
### Fixed
|
10
19
|
- metrics-memory-percent.rb, metrics-memory.rb: change 'usedWOBuffersCaches' and 'freeWOBuffersCaches' calculation to use MemAvailable in /proc/meminfo when available. (@jpoizat)
|
@@ -121,7 +130,9 @@ This CHANGELOG follows the located [here](https://github.com/sensu-plugins/commu
|
|
121
130
|
### Added
|
122
131
|
- initial release
|
123
132
|
|
124
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.0
|
133
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.1.0...HEAD
|
134
|
+
[3.1.1]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.1.0...3.1.1
|
135
|
+
[3.1.0]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.0.1...3.1.0
|
125
136
|
[3.0.2]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.0.1...3.0.2
|
126
137
|
[3.0.1]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/3.0.0...3.0.1
|
127
138
|
[3.0.0]: https://github.com/sensu-plugins/sensu-plugins-memory-checks/compare/2.1.0...3.0.0
|
data/bin/check-memory-percent.sh
CHANGED
@@ -48,15 +48,23 @@ fi
|
|
48
48
|
WARN=${WARN:=80}
|
49
49
|
CRIT=${CRIT:=90}
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
os=$(uname)
|
52
|
+
if [ $os = "Darwin" ]; then
|
53
|
+
#Get total memory available on machine
|
54
|
+
TotalMem=$(sysctl -a | grep '^hw\.m' | cut -d" " -f2)
|
55
|
+
#Determine amount of free memory on the machine
|
56
|
+
FreeMem=$(vm_stat | grep "Pages free" | tr -d '[:space:]' | cut -d: -f2 | cut -d. -f1)
|
57
|
+
elif [ $os = "Linux" ]; then
|
58
|
+
#Get total memory available on machine
|
59
|
+
TotalMem=$(free -m | grep Mem | awk '{ print $2 }')
|
60
|
+
#Determine amount of free memory on the machine
|
61
|
+
set -o pipefail
|
62
|
+
FreeMem=$(free -m | grep buffers/cache | awk '{ print $4 }')
|
63
|
+
if [ $? -ne 0 ]; then
|
64
|
+
FreeMem=$(free -m | grep Mem | awk '{ print $7 }')
|
65
|
+
fi
|
59
66
|
fi
|
67
|
+
|
60
68
|
#Get percentage of free memory
|
61
69
|
FreePer=$(awk -v total="$TotalMem" -v free="$FreeMem" 'BEGIN { printf("%-10f\n", (free / total) * 100) }' | cut -d. -f1)
|
62
70
|
#Get actual memory usage percentage by subtracting free memory percentage from 100
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-memory-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
224
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.6.
|
225
|
+
rubygems_version: 2.6.14
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: Sensu plugins for checking memory
|