Ad Widget

Collapse

Invert percentage trigger?

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • etfz
    Junior Member
    • Apr 2024
    • 19

    #1

    Invert percentage trigger?

    Hi,

    I have a trigger that uses the Linux swap space item, but it displays free space while I would prefer to use used space. The following items exist:
    • system.swap.size[,pfree]
    • system.swap.size[,free]
    • system.swap.size[,total]
    The trigger uses the following expression:
    Code:
    max(/Linux by Zabbix agent/system.swap.size[,pfree],5m)<{$SWAP.PFREE.MIN.WARN} and last(/Linux by Zabbix agent/system.swap.size[,total])>0
    And a custom operational data string like so:
    Code:
    Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}
    I don't fully understand how the value macros in operational data work, but as far as I can tell, it's "smart", and inverting this metric does not seem obvious. I suspect I might need to modify the items or add new ones. How might I go about this?
  • Answer selected by etfz at 03-12-2024, 12:13.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806


    But the docs.... https://www.zabbix.com/documentation...s/zabbix_agent
    system.swap.size[<device>,<type>]
    Swap space size in bytes or in percentage from total. Integer - for bytes

    Float - for percentage
    device - device used for swapping (default is all)
    type - possible values:
    free (free swap space, default), pfree (free swap space, in percent), pused (used swap space, in percent), total (total swap space), used (used swap space)
    Note that pfree, pused are not supported on Windows if swap size is 0.
    See also platform-specific details for this parameter.
    Example:
    => system.swap.size[,pfree] → free swap space percentage

    If device is not specified Zabbix agent will only take into account swap devices (files), physical memory will be ignored. For example, on Solaris systems swap -s command includes a portion of physical memory and swap devices (unlike swap -l).

    Note that this key might report incorrect swap space size/percentage on virtualized (VMware ESXi, VirtualBox) Windows platforms. In this case you may use the perf_counter[\700(_Total)\702] key to obtain correct swap space percentage.
    add another item and use it... I guess going from pfree to pused you need to switch trigger logic also ...

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #2

      But the docs.... https://www.zabbix.com/documentation...s/zabbix_agent
      system.swap.size[<device>,<type>]
      Swap space size in bytes or in percentage from total. Integer - for bytes

      Float - for percentage
      device - device used for swapping (default is all)
      type - possible values:
      free (free swap space, default), pfree (free swap space, in percent), pused (used swap space, in percent), total (total swap space), used (used swap space)
      Note that pfree, pused are not supported on Windows if swap size is 0.
      See also platform-specific details for this parameter.
      Example:
      => system.swap.size[,pfree] → free swap space percentage

      If device is not specified Zabbix agent will only take into account swap devices (files), physical memory will be ignored. For example, on Solaris systems swap -s command includes a portion of physical memory and swap devices (unlike swap -l).

      Note that this key might report incorrect swap space size/percentage on virtualized (VMware ESXi, VirtualBox) Windows platforms. In this case you may use the perf_counter[\700(_Total)\702] key to obtain correct swap space percentage.
      add another item and use it... I guess going from pfree to pused you need to switch trigger logic also ...

      Comment

      • etfz
        Junior Member
        • Apr 2024
        • 19

        #3
        Thanks. I guess I assumed that the templates would have items defined for all keys already.
        Last edited by etfz; 03-12-2024, 12:18.

        Comment

        Working...