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. NXSL script help

NXSL script help

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

    Hi,

    when I add a filtering script to the event processing policy, where i can found the output of the print/println command?
    If i add a print or a println command to the filter script, when the event occuor i can't find the output in the remote console server or in the server console or in other way.

    Another questions...in the filtering script of event processing policy, can i put directly the code?Or, have I to add the declaration of the main (sub main(){etc )

    I have to create a filter script that send the alarm's mail for an interface down for only specific interface...
    I tried to insert in the event processing police as source the specific interface, but did'nt work; so i use as source the switch and i wanna to add a filter script that select for which interface the alarm's mail have to start. Any suggestion?

    1 Reply Last reply
    0
    • S
      S
      SKYnv
      wrote on last edited by
      #2

      http://wiki.netxms.org/wiki/NXSL:trace

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

        Hi!

        @tivanni said in NXSL script help:

        when I add a filtering script to the event processing policy, where i can found the output of the print/println command?
        If i add a print or a println command to the filter script, when the event occuor i can't find the output in the remote console server or in the server console or in other way.

        You should use trace() function to write messages to server's log.

        @tivanni said in NXSL script help:

        Another questions...in the filtering script of event processing policy, can i put directly the code?Or, have I to add the declaration of the main (sub main(){etc )

        Yes, you can write code directly. Defining main() is not necessary. Also, the following code is also valid:

        trace(0, "main() starts here");
        
        sub someFunction()
        {
        }
        
        trace(0, "main() continues here");
        

        @tivanni said in NXSL script help:

        I have to create a filter script that send the alarm's mail for an interface down for only specific interface...
        I tried to insert in the event processing police as source the specific interface, but did'nt work; so i use as source the switch and i wanna to add a filter script that select for which interface the alarm's mail have to start. Any suggestion?

        Source of interface down event is the node. You can filter events using script by interface name or index. For example, to pass SYS_IF_DOWN events only for interface named "eth2", you can use the following script:

        return $2 == "eth2";
        

        We use $2 here because interface name passed as second parameter with SYS_IF_DOWN event. You can see this from event description:

        Generated when interface goes down.
        Please note that source of event is node, not an interface itself.
        Parameters:
          1) Interface object ID
          2) Interface name
          3) Interface IP address
          4) Interface netmask
          5) Interface index

        Best regards,
        Victor

        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