Ad Widget

Collapse

Subfunction in trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Statix
    Junior Member
    • Sep 2012
    • 1

    #1

    Subfunction in trigger

    Hi everyone!
    I have an item that returns simple text message after execution of some script.
    I created a trigger for that function:

    {qwerty:check_qwerty.sh.regexp(Text that says everything is fine)}=0

    .sh script generate false alarms sometimes, so firstly I want to modify the trigger to make a real notification after several checks. This might look like this:

    {qwerty:check_qwerty.sh.regexp(Text that says everything is fine).last(#3)}=0

    But this doesn't work. I'll be very grateful for any ideas on how to make this work.
  • mbsit
    Senior Member
    • Sep 2012
    • 130

    #2
    Hi

    Sub function is not possible.

    Do not use String as a return value, in yours SH script use something like:

    if <something wrong> echo 1
    else
    echo 0

    Then you can use, last/avg/sum and other functions i triggers.

    Bests,
    Grzegorz

    --
    Wdrożenia Zabbix - Warszawa
    Pozdrawiam
    Grzegorz Grabowski
    ____
    WdroĊĵenia, szkolenia, umowy serwisowe
    Warszawa - Polska

    Comment

    Working...