Ad Widget

Collapse

Different check value in notification message ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • petar_kozic
    Junior Member
    • May 2017
    • 1

    #1

    Different check value in notification message ?

    Hi Folks,

    I have one question for you.

    I'm have configired Slack notification and I have configured trigger and actions for MySQL service.
    Trigger is set if MySQL down, Action send Slack notification.
    That's works perfectly.

    But... I have problem if I want to send in that's notification value from some other check, on example system.cpu.load[,avg1]

    Can I send different check value in notification messages ?

    On example I want notification like this:


    PROBLEM:test-zabbix:MySQL is down.
    Host: test-zabbix
    MySQL is down

    Processor load is: {HOST.HOST:system.cpu.load[,avg1].last()}
    Available memory is: ....

    Thank you in advanced.
  • ovas
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Apr 2017
    • 138

    #2
    Hello!

    One way I can see this possible is to construct a trigger with multiple conditions that always are met:
    <your MySQL trigger expression> and <cpu.load<0> and <memory.free>0>
    In such improvised trigger it will fire only when MySQL down, still passing the values of host CPU load and RAM free to action.

    On the action level though, in message contents you use {ITEM.KEY2} and {ITEM.KEY3} with {ITEM.VALUE2} and {ITEM.VALUE3} macros, thus passing values from the trigger.

    For example, an improvised trigger
    Code:
    {Template Basic:system.cpu.load[all,avg1].last()}>1 and {Template Basic:mysql.uptime.last()}>0
    will send the following notification contents:
    Code:
    CPU load too high (centos7_zbserver3.2:system.cpu.load[all,avg1]): 1.67
    MySQL uptime (centos7_zbserver3.2:mysql.uptime): 23d 5h 46m

    Comment

    Working...