Compare commits

...

2 Commits

Author SHA1 Message Date
Jérémy Dubois 7fc4e0c7d7 Update CHANGELOG
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2021-02-15 17:33:12 +01:00
Jérémy Dubois 54455a63df Fix check_free_mem.sh : cached RAM now is free RAM 2021-02-15 17:30:25 +01:00
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [6.8.3] - 2021-02-08 ## [6.8.3] - 2021-02-15
### Added ### Added
@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fix the check_mem in the NRPE role, precising the percentage sign for it not to check the memory in MB. - Fix the check_mem command in the NRPE role, precising the percentage sign for it not to check the memory in MB.
- Fix the check_mem script in the NRPE role, adding cached RAM as free RAM
### Changed ### Changed

View File

@ -67,7 +67,7 @@ tot_mem=$(( `/sbin/sysctl -n hw.physmem` / BYTES_IN_MB))
{% if ansible_distribution_version is version_compare("6.2",'<') %} {% if ansible_distribution_version is version_compare("6.2",'<') %}
free_mem=$(( `/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $5 }'` / KB_IN_MB )) free_mem=$(( `/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $5 }'` / KB_IN_MB ))
{% else %} {% else %}
free_mem=$(/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $4 }' | tr -d 'M') free_mem=$(($(/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $4 }' | tr -d 'M') + $(top -n | grep Memory | awk '{print $8}' | tr -d 'M')))
{% endif %} {% endif %}
# Free memory size (in percentage) # Free memory size (in percentage)
free_mem_perc=$(( free_mem * 100 / tot_mem )) free_mem_perc=$(( free_mem * 100 / tot_mem ))