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. Handle varbinds/parameters OID

Handle varbinds/parameters OID

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 19.4k 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.
  • S
    S
    Stardust
    wrote on last edited by
    #1

    Hi,

    I don't understand how to handle parameters on EPP script, I explain:

    I've created a trap,

     OID: .1.3.6.1.4.1.9789.0.1500
    with different parameters like $2 :.1.3.6.1.4.1.9789.1500.1.5 and so on
    

    An event is associated to that trap.

    Then, I only wanted to compare on EPP the parameter received by the trap like:

    if ($2 == ".1.3.6.1.4.1.9789.1500.1.5'") return 1;
    

    How should I do that?

    Sorry if the subject was already posted.

    Regards.

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

      Hi,

      basically you write it correctly (with one type):

      if ($2 == ".1.3.6.1.4.1.9789.1500.1.5") return 1;

      or simply

      return $2 == ".1.3.6.1.4.1.9789.1500.1.5";

      Best regards,
      Victor

      1 Reply Last reply
      0
      • S
        S
        Stardust
        wrote on last edited by
        #3

        Thank you Victor but it doesn't work 😞

        I simplified my problem because there is something that I don't understand:

        1)My trap
        2)My event
        3) trap received: FW01 .1.3.6.1.4.1.9789.1500 .1.3.6.1.4.1.9789.1500.2.5 == '[GRE-FW01][INFO][005]'
        (That means login error)

        Then on my epp I only wanted to compare the oid of the parameter/varbind received: .1.3.6.1.4.1.9789.1500.2.5 or .1.3.6.1.4.1.9789.1500.1.5

        My script:

        if ( index($event->parameter[3], ".1.3.6.1.4.1.9789.1500.2.5") return 1;
         		else return 0;
        

        doesn't work


        trap.jpg

        event.jpg

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

          Now I understand. The problem is that when mapping of trap to event happens, only values are copied, not OIDs (value of $event->parameters[3] will be "[GRE-FW01][INFO][005]" in your example). But, if you have two parameter mappings on different OIDs, and only one of them can be present in actual trap, that means that other parameter will be empty. So, if you have mapped .1.3.6.1.4.1.9789.1500.1.5 to parameter #2 and .1.3.6.1.4.1.9789.1500.2.5 to parameter #3, you can simply check if parameter 2 is empty - if it is, you have .1.3.6.1.4.1.9789.1500.2.5, otherwise .1.3.6.1.4.1.9789.1500.1.5.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • S
            S
            Stardust
            wrote on last edited by
            #5

            Ok Thanks a lot.

            Regards

            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