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. Deleting Objects interfaces

Deleting Objects interfaces

Scheduled Pinned Locked Moved Support
12 Posts 4 Posters 90.8k 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.
  • D
    D
    David Jesus
    wrote on last edited by
    #3

    Thx Stan, I used your example, I changed it to help me but the problem is that the ports are still coming back.
    I want the ports fa1 to fa8 to but I does not work.
    I am using this script:
    if ($1->name ilike "*fa.*"){
      return false;}

    return true;

    1 Reply Last reply
    0
    • S
      S
      StanHubble
      wrote on last edited by
      #4

      Yeah I tried wildcards too.....didn't work.
      Ugly, but I ended up with a if( ){} structure for each interface name that i didn't want and that worked.
      (elminated about 9600 interfaces)

      1 Reply Last reply
      0
      • D
        D
        David Jesus
        wrote on last edited by
        #5

        Looks that I have to do the same, thx again for the help.

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

          The following should actually work:

          if ($1->name ilike "*fa*") { return false;}
          return true;
          

          Note that that your code was comparing to "*fa**.***"

          You could also use:

          if ($1->name imatch "fa") { return false;}
          return true;
          
          1 Reply Last reply
          0
          • D
            D
            David Jesus
            wrote on last edited by
            #7

            Thx Tursiops the code works!

            1 Reply Last reply
            0
            • J
              J
              JayST
              wrote on last edited by
              #8

              I also resolved the (re)addition issue using the Hook::CreateInterfaces script and filter some names there, but what would be the easiest way to remove the unwanted interfaces across a bunch of nodes that got added before filtering?

              1 Reply Last reply
              0
              • T
                T
                Tursiops
                wrote on last edited by
                #9

                You could write a script to go through all devices, enumerate the interfaces and utilise the DeleteObject function in NXSL to remove the interfaces. Or you could add the interface enumeration and delete to the configuration poll hook.

                1 Reply Last reply
                0
                • J
                  J
                  JayST
                  wrote on last edited by
                  #10

                  Ok thanks.
                  About running such one-time scripts:
                  Would i need to create a script in the script library and run it in the debug console with exec command? Or is there a easier “run this script now” functionality?

                  1 Reply Last reply
                  0
                  • T
                    T
                    Tursiops
                    wrote on last edited by
                    #11

                    You can right-click on any node to execute a server script (I'm assuming that's what you mean as debug console?) and just write your code in there. Your code wouldn't be node specific (if you are indeed enumerating all nodes and then all interfaces per node) so it doesn't matter against which node you run it. Or you could write it in the script library and then select it from the drop down. Or you could schedule a task that runs a script from the script library.

                    1 Reply Last reply
                    0
                    • J
                      J
                      JayST
                      wrote on last edited by
                      #12

                      that sums it up quite good! great stuff, thanks.
                      with debug console i actually meant the server console from the Tools menu.

                      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