[ZBX-17654] Unneeded use of JS in template "Memory utilization" Created: 2020 Apr 29  Updated: 2024 Apr 10  Resolved: 2020 Jun 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 4.4.8
Fix Version/s: 5.0.1rc1, 5.0.2rc1, 5.2.0alpha1, 5.2 (plan)

Type: Problem report Priority: Trivial
Reporter: patrik uytterhoeven Assignee: Tikhon Uskov (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1.png     PNG File 2.png     PNG File pavailable-with-js.png     PNG File pavailable.png     PNG File pavailable.png    
Team: Team INT
Sprint: Sprint 64 (May 2020), Sprint 65 (Jun 2020)
Story Points: 0.25

 Description   

in the memory template for "Memory utilization" the option vm.memory.size[pavailable] is used to calculate the % free memory and in preprocessing JS is used to calculate the % in use. why not just use pused instead of pavailable with JS ?

this is complicating readability of this trigger a lot

{TEMPLATE_NAME:vm.memory.size[pavailable].min(5m)} >{$MEMORY.UTIL.MAX}

as one would think that 10% free memory over 5min needs to be bigger then 90 to fire off the trigger and this makes no sence of course. So it took me some time to figure out what was the catch.

https://github.com/zabbix/zabbix/tree/master/templates/os/linux_active

also for passive



 Comments   
Comment by Edgar Akhmetshin [ 2020 May 05 ]

Hello Patrik,

In terms of memory utilisation pused will show data differently:

$ zabbix_agentd -t vm.memory.size[pavailable]
vm.memory.size[pavailable]                    [d|48.995366]

$ zabbix_agentd -t vm.memory.size[pused]
vm.memory.size[pused]                         [d|88.454704]

https://www.kernel.org/doc/Documentation/filesystems/proc.txt
https://www.zabbix.com/documentation/current/manual/appendix/items/vm.memory.size_params

Also please note, description of the item is provided correctly:

Memory used percentage is calculated as (100-pavailable)

Regards,
Edgar

Comment by patrik uytterhoeven [ 2020 May 13 ]

ok i see your point

avaialable is showing more then free also buffers etc. so indeed pused is not an option.

 

still the trigger is confusing due to the javascript as one would think available memory is ex 36% but with the JS now we have 63% as value so for the macro in our trigger we have to use a macro of 90% for pavailable instead of 10% 

this makes the trigger very confusing

 

Problem:

 

{[someserver:vm.memory.size[pavailable]|https://monitor.cumuli.be/items.php?form=update&itemid=2295482].*min(*30m*)*}

>{$MEMORY.UTIL.MAX}

 

Comment by Edgar Akhmetshin [ 2020 May 13 ]

Hello Patrik,

Template description: Memory used percentage is calculated as (100-pavailable)

  • Item name: Memory utilization
  • Item key: vm.memory.size[pavailable]
  • Item preprocessing: 100-vm.memory.size[pavailable]
  • Trigger name: High memory utilization ( >{$MEMORY.UTIL.MAX}% for 5m)
  • Trigger configuration: {Zabbix server:vm.memory.size[pavailable].min(5m)}>{$MEMORY.UTIL.MAX}

Simplified: Memory utilization > macro {$MEMORY.UTIL.MAX} = report problem, if changes required - set this value lower or higher.

There is no separate key for measuring memory utilization. If use your example, the data element and trigger settings will operate with different values, which will lead to confusion: item name - utilization, key and value - memory available, trigger - memory available < X. Using different item name and trigger also confusing.

Currently where is no indication for items if preprocessing is used, you need to open preprocessing tab, covered by: ZBXNEXT-4803, but template is documented and logic for the item looks clear, if not rely only on item key, especially with rich abilities to transform data using preprocessing steps and other options.

Please suggest.

Regards,
Edgar

Comment by patrik uytterhoeven [ 2020 May 13 ]

my point was that JS is not needed here and making the trigger more confusing

 

i don't know if others agree or not 

documentation is ok that was never my issue 

 

i really don't see the point of using JS in this item and then building a trigger on this item that works all the way different as one would expect without looking at the preprocessing tabs in the item.

Comment by Tikhon Uskov (Inactive) [ 2020 Jun 03 ]

Available in :

 

Generated at Sat Jun 07 12:05:22 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.