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. SNMP Trap Threshold

SNMP Trap Threshold

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 18.1k 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.
  • G
    G
    gmonk63
    wrote on last edited by
    #1

     Is there any way to set a threshold for received traps or alarms ? We have a few switches where the connected devices sometimes will have a faulty power supply and will randomly cause the device to constantly reboot causing the port to go up and down generating  SNMP_LINK_UP  SNMP_LINK_DOWN  traps.  I would like to generate an alarm/notification if there are say 10 or more back to back up down events received within 5min to notify me that the port is flapping. I think this would be useful to be able to do the same for certain alarms due to some alarms can trigger then rearm on the next check and can sometimes be easily missed.

    Thanks..

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      This could be done using filtering script in EPP. That script should keep last 10 timestamps somewhere (in persistent storage or in custom attribute of the node, as comma-separated list) and check if all these timestamps fit within 5 min interval.
      Do you need an example of such script?

      1 Reply Last reply
      0
      • G
        G
        gmonk63
        wrote on last edited by
        #3

        I will give it a try myself and if I can not figure it out I will circle back and ask for assistance.  Thank you for pointing me in the right direction.

        1 Reply Last reply
        0
        • G
          G
          gmonk63
          wrote on last edited by
          #4

          ok so I was able to to achieve what I wanted with the following its hacky  but if works. How do I go about terminating this alarm ? I want to terminate the alarm as soon as the time expires.

          ts = ReadPersistentStorage("ts_".$node->name);

          if(ts == NULL){
          /* create initial timestamp and event*/
          WritePersistentStorage("ts_".$node->name,$event->timestamp);
          WritePersistentStorage($node->name,1);
          return;
          }
          /* if within time range of 10min check storage */
          if (time() - ts <=600){
           
          events = ReadPersistentStorage($node->name);
          WritePersistentStorage($node->name,events+1);
          if (events!=NULL ){

          if (events >=5){
          return true;
          }
          }

          }else{

          /* if time is over 10min reset storage values for timestamp and event*/
          WritePersistentStorage($node->name, NULL);
          WritePersistentStorage("ts_".$node->name, NULL);

          }

          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