Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Event based on resolving an alarm timeout

Event based on resolving an alarm timeout

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 23.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    B
    bulwer
    wrote on last edited by
    #1

    Hi,

    I installed NetXMS a couple of days ago and like what I see so far. I will play with advanced stuff later but for now I just want to add all of our routers and servers across 35 sites and have it tell us when they are down. However, because a lot of our sites are linked with ADSL lines which go down quite often, I only want an email after 5 minutes of being down.

    I have got this working by using the Alarm Timeout so when the Alarm Timeout kicks in after 5 minutes, we get an email and this works great. However, I am struggling to come up with a way to get it to email us when the node is back up but only if the Alarm Timeout alarm was raised. I have set it to resolve the alarm timeout when the node comes up but if I add the email at that point, it will email me every time a node comes back up so we will get emails saying a node is up when we didn't get one to say it was down as it was only down for less than 5 minutes.

    Is there a way I can add an Event Policy to run when an Alarm Timeout is resolved?

    Many thanks

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      You can achieve this by storing timestamp of node down event and checking it on node up. You can use custom attributes and scripting for this. For example, you can create the following script in script library, named "OnNodeDown" for example:

      SetCustomAttribute($node, "nodeDownTimestamp", time());
      

      then create action "execute script" to execute "OnNodeDown" script, and add it in event processing policy to the rule processing SYS_NODE_DOWN event.

      Then create separate rule for sending e-mails on SYS_NODE_UP, with additional filtering script like this:

      t = GetCustomAttribute($node, "nodeDownTimestamp");
      interval = time() - t;   // get interval in seconds between down and up events
      return (interval >= 300);
      

      With this filtering script, only SYS_NODE_UP events happens 5 or more minutes later then SYS_NODE_DOWN event will pass the filter.

      More information about scripting you can found here: http://wiki.netxms.org/wiki/Scripting_Guide.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • B
        B
        bulwer
        wrote on last edited by
        #3

        Many thanks Victor - I have just got around to this and it works perfectly. Thanks for your help.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups