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. Forward Incoming traps to external application

Forward Incoming traps to external application

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 99.5k 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.
  • T
    T
    tamal_g
    wrote on last edited by
    #1

    Hi,
    I have a perl script which accepts SNMP traps as standard input. I want the incoming traps in NetXMS forward to that particular perl script. I want to call standard dos batch file from Netxms ver 1.2.9 with SNMP traps as input parameters which will invoke the perl script and pass on the same trap information for further processing.

    Thanks

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

      Hi!

      All SNMP traps are converted into events in NetXMS server. All you have to do is to call external script from event processing policy as a reaction to these trap-originated events. You can define "execute command on management server" action to call local script on NetXMS server.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • T
        T
        tamal_g
        wrote on last edited by
        #3

        Thanks Victor,

        As you suggested I have already converted my incoming traps into events. I have written a test script which will print "Hello" and I have added that action from event processing policy. But I am not able to see the output of the script. Can you please guide me where I could see the console output as "Hello" (it is not showing in "Server Console").

        Thanks
        Tamal

        1 Reply Last reply
        0
        • T
          T
          tamal_g
          wrote on last edited by
          #4

          Hi Victor,

          I want to run a batch file with a trap event which I have already configured in "Event Processing Policy". I have selected the option "Execute command on management server" and have put the command line as "cmd.exe /C Test.bat" (which is my test batch file located in system folder). But unfortunately this batch file is not executed with the configured event.

          Can you provide some tips to run this?

          Thanks,
          Tamal

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

            Hi!

            I suggest to run server with debug level 4 or higher and check server log. Maybe there are errors at command execution, or it is not executed at all. You can change debug level in run time by opening server debug console (from Tools->Server Console menu) and entering command debug 5 (or whatever debug level you need).

            Best regards,
            Victor

            1 Reply Last reply
            0
            • T
              T
              tamal_g
              wrote on last edited by
              #6

              Thanks Victor,

              Fortunately I could run my batch file from the command line. Actually the bat file was executed but I was unable to see the command window, so I have checked the option "Allow service to interact with desktop" of NetXMS core service properties and by doing that it worked.
              Now I want to pass the incoming SNMP trap as a whole including the variable bindings into my batch file as input parameters. I have tried by using some macros but till now no luck.
              Can you please suggest the steps which I should follow so that I can get the whole trap in my bat file.

              Thanks.
              Regards,
              Tamal

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

                You have to get all bindings from trap into event, then you can use macros %2, %3, and so on to insert values of those varbinds into script command line. You can check interface up/down traps to see how varbinds are mapped to event parameters.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • T
                  T
                  tamal_g
                  wrote on last edited by
                  #8

                  I understand that fact and I have already configured it like what you suggested. But my problem is I cannot get the text value which is actually associated with a particular variable in my MIB file. For example when SNMP trap is coming from my device in NetXMS I cant get the value of the variable (say 'status') of that particular trap as '4' . In the MIB file this status object is defined as if value is '4' then it should send value as 'highcritical' that is what I am not able to get.
                  Can you help to to get that and also how can I associate an object defined in my MIB file with a newly created node.

                  Thanks in advance.

                  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