Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows check_memory never gets critical #6810

Closed
idandr opened this issue Nov 29, 2018 · 3 comments · Fixed by #6811
Closed

Windows check_memory never gets critical #6810

idandr opened this issue Nov 29, 2018 · 3 comments · Fixed by #6811
Assignees
Labels
area/windows Windows agent and plugins bug Something isn't working
Milestone

Comments

@idandr
Copy link

idandr commented Nov 29, 2018

Expected Behavior

When free memory passes critical threshold, status and output should change to CRITICAL.

Current Behavior

If a warning threshold is given, the check never changes to a crtitical status.

Possible Solution

As far as I understand the code in master, one should check for critical threshold first. At the moment, warning threshold is checked first and if the condition is met, the check for critical threshold is never reached. The same conditions are used in check_swap, so it is affected too, probably.

Steps to Reproduce (for bugs)

  1. Set a warning threshold that is above free memory to get a critical status:

    .\check_memory.exe -u mb -c 55%
    MEMORY CRITICAL - 52.8615% free| 'memory'=17321.4MB;;18022.1525;0;32767.5

  2. Add a warning threshold:

    .\check_memory.exe -u mb -c 55% -w 60%
    MEMORY WARNING - 52.7642% free| 'memory'=17289.5MB;19660.529999999999;18022.1525;0;32767.5

Status changes from critical to warning instead of staying critical.

@mcktr mcktr added Plugins area/windows Windows agent and plugins labels Nov 29, 2018
@mcktr
Copy link
Member

mcktr commented Nov 29, 2018

Confirmed.

.\check_memory.exe -u mb -w 55%
MEMORY WARNING - 48.2859% free| 'memory'=1977.57MB;2252.5525000000002;;0;4095.55

.\check_memory.exe -u mb -w 55% -c 60%
MEMORY WARNING - 48.3815% free| 'memory'=1981.49MB;2252.5525000000002;2457.3299999999999;0;4095.55

Also for the used memory

.\check_memory.exe -u mb -w 45% -c 50% -U
MEMORY WARNING - 51.6689% used| 'memory'=2116.12MB;1842.9975000000002;2047.7750000000001;0;4095.55

@mcktr mcktr added the bug Something isn't working label Nov 29, 2018
@mcktr mcktr self-assigned this Nov 29, 2018
@mcktr
Copy link
Member

mcktr commented Nov 29, 2018

Also visible in check_swap.

.\check_swap.exe -u mb -w 90%
SWAP WARNING - 85.7978% free | 'swap'=1027MB;1077.3;;0;1197

.\check_swap.exe -u mb -w 90% -c 95%
SWAP WARNING - 87.9699% free | 'swap'=1053MB;1077.3;1137.1499999999999;0;1197

.\check_swap.exe -u mb -w 10% -U
SWAP WARNING - 12.782% used | 'swap'=153MB;119.7;;0;1197

.\check_swap.exe -u mb -w 10% -c 11% -U
SWAP WARNING - 12.782% used | 'swap'=153MB;119.7;131.66999999999999;0;1197

@mcktr
Copy link
Member

mcktr commented Nov 29, 2018

Thanks for reporting. 👍 I prepared a patch to tackle this issue in check_memory and check_swap.

@dnsmichi dnsmichi added this to the 2.10.3 milestone Dec 3, 2018
@dnsmichi dnsmichi added area/windows Windows agent and plugins and removed area/windows Windows agent and plugins labels May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Windows agent and plugins bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants