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. Add custom parameter to Event Template?

Add custom parameter to Event Template?

Scheduled Pinned Locked Moved Support
7 Posts 3 Posters 35.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.
  • N
    N
    ntnam
    wrote on last edited by
    #1

    Event SYS_IF_DOWN has default message Interface "%2" changed state to DOWN (IP Addr: %3/%4, IfIndex: %5)
    How can i add %6 or %? with interface ifAlias?

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

      Hi,

      interface alias is not passed to SYS_IF_DOWN. You can create script in script library called GetInterfaceAlias with the following code:

      return GetInterfaceObject($node, $event->parameters[5])->alias;
      

      and then use macro %[GetInterfaceAlias] in message text.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • N
        N
        ntnam
        wrote on last edited by
        #3

        Yes. Thanks you very much.

        1 Reply Last reply
        0
        • N
          N
          ntnam
          wrote on last edited by
          #4

          Event SYS_THRESHOLD_REACHED don't have parameter index of interface.
          Can i store it from Threshold Script and get it in Event?
          Can you show me another way to get it?

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

            In version 3.0 you can set interface as related object for DCI and then access it via DCI object.

            Best regards,
            Victor

            1 Reply Last reply
            0
            • N
              N
              ntnam
              wrote on last edited by
              #6

              I create the script GetInterfaceAlias

              if ($dci==null)
                return "?";
              else
                return GetInterfaceObject($node, $dci->instanceData)->alias;
              

              and using macro in message %[GetInterfaceAlias] but this return "?"
              my threshold script run correct

              ifo = GetInterfaceObject($node, $dci->instanceData);
              speed = ifo->speed;
              if (speed!=null)
                if ($1/speed*100 > $2)
                  return true;
              return false;
              

              I'am using NETXMS 3.0.2287.
              Can you tell me my mistake.

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

                Currently $dci is not supported when a script is called from event processing. For SYS_THRESHOLD_EVENTs DCI ID is passed as 5-th parameter of $event:

                trace(1, "Script on SYS_THRESHOLD_EVENT: DCI ID: ".$event->parameters[5]+0);
                trace(1, "Script on SYS_THRESHOLD_EVENT: DCI name: ".GetDCIObject($node,($event->parameters[5]))->name);
                trace(1, "Script on SYS_THRESHOLD_EVENT: Interface name: ".GetDCIObject($node,($event->parameters[5]))->relatedObject->name);
                
                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