Ad Widget

Collapse

How to create triggers with swap pused unsupported

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jonybat
    Junior Member
    • May 2019
    • 11

    #1

    How to create triggers with swap pused unsupported

    Hi

    Currently running v4.4.10, and stumbled upon some issue related to triggers using the swap pused item.

    We have a trigger like this:
    Code:
    {OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}>={$MEMORY_HIGH} and {OS Linux server - P:system.swap.size[,pused].min({$T_SYSTEM_SHORT})}>={$SWAP_MEDIUM}
    It works fine for servers that have swap, however, for servers that do not have swap, it fails the calculation, because the "system.swap.size[,pused]" item becomes unsupported, with the info: Cannot be calculated because swap file size is 0.

    I tried getting around it by defining a preprocessing step to that item, to match against the regex [0-9]+, with custom on fail to set value to 100. However, it does not work.

    I would like to know if there is a solution for this other than having different templates for servers that do not have swap.

    Cheers
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Looks like you hit https://support.zabbix.com/browse/ZBXNEXT-6784

    You are welcome to follow it. The fix is planned for 5.0 and 5.4 though as 4.4 is not supported anymore.

    Comment

    • jonybat
      Junior Member
      • May 2019
      • 11

      #3
      Okay, thanks

      Comment

      • jonybat
        Junior Member
        • May 2019
        • 11

        #4
        In case someone stumbles upon this, after updating to 5.0, our triggers had to be updated, since "system.swap.size[,pused]" returns 0 for systems without swap.

        Maybe there is an easier way to do this, but here they are:
        Code:
        High - High memory usage
        
        Problem: ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}>={$MEMORY_HIGH} and {OS Linux server - P:system.swap.size[,pused].min({$T_SYSTEM_SHORT})}>={$SWAP_HIGH}) or ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}>={$MEMORY_HIGH} and {OS Linux server - P:system.swap.size[,total].last()}=0)
        
        Recovery: ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}<{$MEMORY_HIGH_TH} and {OS Linux server - P:system.swap.size[,total].last()}=0) or ({OS Linux server - P:system.swap.size[,pused].min({$T_SYSTEM_SHORT})}<{$SWAP_HIGH_TH} and {OS Linux server - P:system.swap.size[,total].last()}>0)
        
        
        Medium - High memory usage
        Depends on: OS Linux server - P: High memory usage (the trigger above with higher severity)
        
        Problem: ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}>={$MEMORY_HIGH} and {OS Linux server - P:system.swap.size[,pused].min({$T_SYSTEM_SHORT})}>={$SWAP_MEDIUM}) or ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}>={$MEMORY_MEDIUM} and {OS Linux server - P:system.swap.size[,total].last()}=0)
        
        Recovery: ({OS Linux server - P:vm.memory.size.used.min({$T_SYSTEM_SHORT})}<{$MEMORY_MEDIUM_TH} and {OS Linux server - P:system.swap.size[,total].last()}=0) or ({OS Linux server - P:system.swap.size[,pused].min({$T_SYSTEM_SHORT})}<{$SWAP_MEDIUM_TH} and {OS Linux server - P:system.swap.size[,total].last()}>0)
        Cheers
        Last edited by jonybat; 07-02-2022, 15:41.

        Comment

        Working...