Ad Widget

Collapse

Display macro in alternate unit?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jasonsbailey
    Junior Member
    • Oct 2014
    • 6

    #1

    Display macro in alternate unit?

    Hello all,

    I've recently built a template that monitors several ZFS pools that I manage, and all is good except I'm trying to figure out if there is a way to override the unit of measure for a given item that gets displayed when the trigger is activated. Let me clarify...

    One item in the template reflects the amount of allocated space on my ZFS pool (in bytes). The item uses the "B" unit, and reports as "102.06 GB" on the "latest data" page. I also have another item that shows the current health of the pool (i.e. "ONLINE", "DEGRADED", etc).

    If the health of the pool is anything BUT online, it triggers an alarm. Well, in the alarm, I want details on the array (like the amount of allocated space on that pool). Well, it prints, but I get the value in bytes (i.e. 109581049856) instead of something that is more human readable like "102.06 GB"

    I'm wondering if there is a way to print macros in alert messages in an alternate unit of measure? Oh... and by the way, I'm passing these values to the message field in the action by way of {TRIGGER.DESCRIPTION}. If there's a better way, I'm all ears.

    Thanks!!
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    Do you mind to show screenshot with your:
    - items (for Free space and for Status)
    - trigger configuration
    - Action configuration (default message)
    - message which you get.

    For the start I will say - create a complicated trigger which will have two parts:
    - important part which will compare status with ONLINE keyword
    - informational part which will compare Free Space with something like 0

    Code:
    {HOST:pool.health.str(ONLINE,1)}=0 and {HOST:pool.freespace.last()}<1
    And after that you can use default Action message template, where:
    - {ITEM.VALUE1} = health of your pool
    - {ITEM.VALUE2} = free space of your pool in human readable view.
    Sincerely yours,
    Aleksey

    Comment

    • db100
      Member
      • Feb 2023
      • 61

      #3
      * is it possible to display unit of measures in alert messages, like : "{EVENT.UOM}" ?
      * and also, is it possible to perform simple math on the event data, e.g. "{EVENT.OP_DATA} * 10" ?

      thanks

      Comment

      Working...