Ad Widget

Collapse

Show calculated value in trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexanders77
    Junior Member
    • Aug 2018
    • 2

    #1

    Show calculated value in trigger name

    Hello

    I created a trigger, which fires if the memory usage of our redis goes above a certain threshold (80%), like so with the following expression in a template:
    Code:
    ({Template App Redis:redis.cli.info[6379,used_memory].last()} / {Template App Redis:redis.cli.config.get[6379,{$CONFIG_COMMAND_NAME},maxmemory,2].last()}) * 100 > {$REDIS_MEMORY_USAGE}

    {$REDIS_MEMORY_USAGE} is a template macro with the value of 80.

    To get a better overview on places like the tr_status.php page and also in messaging, I'd like the trigger name to contain the calculated value (-> ({Template App Redis:redis.cli.info[6379,used_memory].last()} / {Template App Redis:redis.cli.config.get[6379,{$CONFIG_COMMAND_NAME},maxmemory,2].last()}) * 100), so that I can VERY quickly see, how severe the issue and actually what value the calc. returned.

    How can I do that?

    Thanks,
    Alexander
  • m_d_c13
    Junior Member
    • Jan 2018
    • 23

    #2
    Hello,

    You can create this calculated item and after that put it in your trigger as a second expression something like: and calculated_item_key.last()>0 (I hope this value will always be above 0). After that put this in your trigger name: Used Memory is {ITEM.LASTVALUE2}

    Comment


    • alexanders77
      alexanders77 commented
      Editing a comment
      Thanks a lot, this worked well.
Working...