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. EPP Script to block OID's from setting alarms - Please Help

EPP Script to block OID's from setting alarms - Please Help

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

    Hey all,

    I'm a little lost, I need to write e EPP script to filter an OID Address.

    The address range I want to filter is:

    .1.3.6.1.2.1.31.1.1.1.6.[filter < 1000] and .1.3.6.1.2.1.31.1.1.1.10.[filter < 1000]

    Can anyone help me with this please?

    With thanks

    Alan Scott

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

      Can you give more details on what are you trying to achieve?
      Do you have a node which has SNMP data for these OIDs?
      Do you have any DCIs on that node?
      What result of the filtering do you expect?

      1 Reply Last reply
      0
      • L
        L
        LogicalNZ
        wrote on last edited by
        #3

        So the issue I have is when a user connects to a vpn these interfaces are created and then the monitoring starts, which is fine.

        The issue is that when the user disconnects from the vpn these interfaces become in a unknown start until they drop off. Thats fine as well, but when they move into the unknown state they produce an alarm (thats what I want to stop happening).

        One of the options I have have put to me is to stop monitoring tunnel interfaces in the EPP all together, the issue with this approach is that I have a number of tunnel interfaces that I do want to monitor, its just the dynamic tunnel interfaces that I don't want to monitor.

        The dynamic interfaces are identified by the following OID's

         .1.3.6.1.2.1.31.1.1.1.6.[greater than 1000] and .1.3.6.1.2.1.31.1.1.1.10.[greater than 1000]

        So my thought to to create some type of script to look for these OID's and tell netXMS not to alert on the interface going to a unknown state.

        I hope that makes it clearer 🙂

        With thanks

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

          It depends on what you want to achieve.

          If you are not interested in these interfaces at all, you can prevent them from creating - modify script "Hook::CreateInterface" in scripting library. Script is executed on configuration poll for each new interface (accessible as $1, https://www.netxms.org/documentation/nxsl-latest/#class-interface) and should return true or false. If return value is false - interface will not be created.

          It's possible to use $1->ifType (interface type as defined by IANA, list of interface types available here: https://github.com/netxms/netxms/blob/master/include/nms_common.h#L908, or can be seen on the object overview tab when interface is selected).
          Or you can query node via SNMP to get some data.

          If you want to keep interfaces in the system, but ignore status change - simplest way is to set “Expected Interface State” to IGNORE. You can do it in configuration poll hook (Hook::ConfigurationPoll).
          Sample:

          for (i : $node->interfaces) {
              if (i->ifType == 131) { // tunnel
                  i->setExpectedState("IGNORE");
              }
          }

          If you want to block events in the EPP, add rule before any alarms or notifications:
          Script:
              i = $node->getInterface($5);
              if (i->ifType == 131) { // or any other filter
                  return true;
              }
              return false;
          Action:
              stop processing

          Alternatively, add script to your alarm / notification rules and return true only if it’s not dynamic interface:
              i = $node->getInterface($5);
              if (i->ifType == 131) { // or any other filter
                  return true;
              }
              return false;

          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