Ad Widget

Collapse

Need help with trigger expression for web.test.fail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vic
    Member
    • Jul 2013
    • 58

    #1

    Need help with trigger expression for web.test.fail

    The only reference to that trigger expression in the documentation is.

    Code:
    {host: web.test.fail[Scenario].last(0)}#0
    I am using that trigger expression to cause an action to restart Apache which I have working. However, sometimes the website doesn't need an Apache restart and is just momentarily busy.

    I can increase the timeout but I also want to have it only trigger if it failed for 5minutes (5x60seconds per test). Just like the host unreachable expression.

    Code:
    {Template OS Linux:agent.ping.nodata(5m)}=1
    There doesn't seem to be any equivalent for web.test.fail. As far as I can tell it returns a 1 or 0 and not nodata. So I think I need something that says if 1 for 5min then 1 otherwise 0.
    Last edited by vic; 12-07-2013, 18:53.
  • mbsit
    Senior Member
    • Sep 2012
    • 130

    #2
    Why don't you use the .count function.

    Or use the calculate item and trigger on calculate one (not for web.test.fail trigger).
    Pozdrawiam
    Grzegorz Grabowski
    ____
    WdroĊĵenia, szkolenia, umowy serwisowe
    Warszawa - Polska

    Comment

    • vic
      Member
      • Jul 2013
      • 58

      #3
      Thanks for the suggestion. This seems to work exactly the way I want.
      Code:
      {host: web.test.fail[Scenario].count(300,1)}>4
      UPDATE: Spoke too soon. Doesn't work. I think the reason is because it takes a little more than 300 seconds for 5 samples. Changing the 4 to a 3 or increasing 300 to something like 350 would probably work. I ended up using SUM instead which is more straight forward and has definitely been working for several hours now.

      Code:
      {host: web.test.fail[Scenario].sum(#5)}>4
      Last edited by vic; 13-07-2013, 18:49.

      Comment

      Working...