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. Filter Script

Filter Script

Scheduled Pinned Locked Moved Support
6 Posts 2 Posters 16.9k 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
    lindeamon
    wrote on last edited by
    #1

    hi,

    i am trying to create a network discovery filter script which will include several "AddrInSubnet" of several different subnets.
    i have managed to create a script with the return function but after reading the use manual i have come to realize that this is not the solution.
    can anyone help ?

    10x,
    Lindeamon

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

      Can you post your script?

      Best regards,
      Victor

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

        sub main()
        {
          return AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0) ||
          return AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0);
        }

        1 Reply Last reply
        0
        • L
          L
          lindeamon
          wrote on last edited by
          #4

          hi victor,

          when i am trying to select a network discovery filter script the "select" button does not work, why is that ?
          i have created a script with the name Filter::xxx ,is that the name i should enter in the script name param. or should i enter just xxx ?

          10x alot,
          lindeamon

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

            Hi!

            Correct script will be

            sub main()
            {
              return AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0") ||
                AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0");
            }

            or simply

            return AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0") ||
                AddrInSubnet($1->ipAddr,"xxx.xxx.xxx.xxx","255.255.255.0");

            You have to enter full name of the script, like Filter::xxx.

            Best regards,
            Victor

            1 Reply Last reply
            0
            • L
              L
              lindeamon
              wrote on last edited by
              #6

              hi victor,

              thanx a lot for your help.
              one last question though, is there a way to do this in a loop where the subnet ip addresses will be declared at the beginning and  the script will check all of them until a match found ?

              something like that:

              a="xxx.xxx.xxx.xxx"
              b="yyy.yyy.yyy.yyy"

              do...until
              return AddrInSubnet($1->ipAddr,a,"255.255.255.0");

              thank u

              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