Ad Widget

Collapse

system.run values do not show in email actions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msmith_mt
    Junior Member
    • May 2012
    • 2

    #1

    system.run values do not show in email actions

    For instance...

    The Email Received:
    Subject: PROBLEM status: MySQL Slave Seconds_Behind_Master exceeded threshold on hostname_removed
    Body:
    Code:
    Value: {hostname_removed:system.run[mysql -u user_removed -ppass_removed -e 'show slave status\G' | grep 'Seconds_Behind_Master' | awk '{print $2}' | sed -r 's;NULL;0;'].last(0)}
    Trigger key: system.run[mysql -u user_removed -ppass_removed -e 'show slave status\G' | grep 'Seconds_Behind_Master' | awk '{print $2}' | sed -r 's;NULL;0;']
    Instead of something like (example):
    Body:
    Code:
    Value: 6853
    Trigger key: system.run[mysql -u user_removed -ppass_removed -e 'show slave status\G' | grep 'Seconds_Behind_Master' | awk '{print $2}' | sed -r 's;NULL;0;']

    Here's the configuration:

    The Item:
    Type: Zabbix Agent
    Key: system.run[mysql -u user_removed -ppass_removed -e 'show slave status\G' | grep 'Seconds_Behind_Master' | awk '{print $2}' | sed -r 's;NULL;0;']
    Type of information: Numeric (unsigned)
    Data type: Decimal
    [...]
    Status: Active
    Store value: As is
    Show value: As is


    The Trigger:
    Name: MySQL Slave Seconds_Behind_Master exceeded threshold on {HOSTNAME}
    Expression: {hostname_removed:system.run[mysql -u user_removed -ppass_removed -e 'show slave status\G' | grep 'Seconds_Behind_Master' | awk '{print $2}' | sed -r 's;NULL;0;'].last(0)}>600
    Event generation: Normal
    [..]
    Disabled: No


    The Action:
    Event source: Triggers
    Enable escalations: No
    Default subject: {STATUS} status: {TRIGGER.NAME}
    Default message:
    Value: {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
    Trigger key: {TRIGGER.KEY}
    Recovery message: No
    Status: Enabled
    Action operations: Send message to Group "group_removed"

    ** This is the only action enabled. **


    Has anyone else seen this and is there a workaround?

    I know it's old, but we're using Zabbix 1.8.1 for the Zabbix Server, Frontend, and Agent. If this has been fixed in later versions of Zabbix, I might be convinced to upgrade.

    Thanks in advance,
    Matt
    Last edited by msmith_mt; 01-06-2012, 16:26.
  • msmith_mt
    Junior Member
    • May 2012
    • 2

    #2
    I went back through the documentation and discovered two macros:

    {ITEM.LASTVALUE<1-9>} - which is the equivalent of what I was using: {{HOST}:{TRIGGER.KEY}.last(0)}

    {ITEM.VALUE<1-9>} - which shows the historical (when the event happened) value

    I haven't tried {ITEM.LASTVALUE1}, but {ITEM.VALUE1} is working great! I hope this helps someone else.

    Comment

    Working...