Check_memory: hide some performance data


#1

I am trying to get some performance data from the check_memory, but only the percentage values.

Here is my command: check_memory "warn=used>70%" "crit=used>90%" "detail-syntax=%(type): Total: %(size) - Used: %(used) (%(used_pct)%) - Free: %(free) (%(free_pct)%)" type=physical type=committed "perf-config='used %'(ignored:true)"

And the result I get when running in nscp test:

L        cli WARNING: WARNING: physical: Total: 11.933GB - Used: 9.792GB (82%) - Free: 2.141GB (17%), committed: Total:40.297GB - Used: 15.508GB (38%) - Free: 24.789GB (61%)
L        cli  Performance data: 'physical'=9.79249GB;8.35315;10.73976;0;11.93307 'physical %'=82%;70;90;0;100 'committed'=15.5079GB;28.20809;36.26754;0;40.29727 'committed %'=38%;70;90;0;100

I tried with several perf-config but I always have the physical and physical % metrics in the performance data … how to get rid of the physical and get only the physical % and committed %?


#2

Is this what you are looking for:

check_memory "warn=used>70%" "crit=used>90%" "detail-syntax=%(type): Total: %(size) - Used: %(used) (%(used_pct)%) - Free: %(free) (%(free_pct)%)" type=physical type=committed "perf-config=%(ignored:true)"
L        cli OK: OK: physical: Total: 15.829GB - Used: 7.092GB (44%) - Free: 8.737GB (55%), committed: Total: 24.329GB - Used: 8.626GB (35%) - Free: 15.703GB (64%)
L        cli  Performance data: 'physical'=7.09165GB;11.08035;14.24617;0;15.82907 'committed'=8.62584GB;17.03035;21.89617;0;24.32907

#3

Thanks. But I am searchinf for the opposite :slight_smile: I want to have the percentage values ONLY.


#4

Then I guess you can use the following:

check_memory "warn=used>70%" "crit=used>90%" "detail-syntax=%(type): Total: %(size) - Used: %(used) (%(used_pct)%) - Free: %(free) (%(free_pct)%)" type=physical type=committed "perf-config=*(ignored:true) %(ignored:false)"
L        cli OK: OK: physical: Total: 15.829GB - Used: 7.865GB (49%) - Free: 7.964GB (50%), committed: Total: 24.329GB - Used: 9.582GB (39%) - Free: 14.747GB (60%)
L        cli  Performance data: 'physical %'=50%;70;90;0;100 'committed %'=39%;70;90;0;100

#5

Many thanks. I will give a try and confirm