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 (Russian)
  3. Autobind по вендору

Autobind по вендору

Scheduled Pinned Locked Moved Support (Russian)
6 Posts 4 Posters 17.4k 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.
  • S
    S
    Stanislav68
    wrote on last edited by
    #1

    Коллеги, не нашел примера в форуме для следующей задачи:

    Как сгруппировать в контейнере все устройства конкретного вендора (первые три поля мак-адреса)?

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

      написать в Automatic bind rules для контейнера код который циклом пройдется по всем интерфейсам ноды и если найдет на одном из них нужный мак - ответи true

      1 Reply Last reply
      0
      • S
        S
        Stanislav68
        wrote on last edited by
        #3

        Кодом не поделитесь, коллега?
        Буду крайне признателен.

        1 Reply Last reply
        0
        • 2
          2
          2c2i
          wrote on last edited by
          #4

          Не поделюсь, тк не использую  Automatic bind rules. Но всё что вам нужно - вернуть в скрипте true если хотите поместить ноду в контейнер или false - если не хотите.

          1 Reply Last reply
          0
          • Z
            Z
            Tatjana Dubrovica
            wrote on last edited by
            #5

            Примерно так:
            interfaces = GetNodeInterfaces($node);
            foreach(i : interfaces)
            {
                return i->macAddr like "85:55:*";
            }
            return false;

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

              Немножко не так:

              interfaces = GetNodeInterfaces($node);
              foreach(i : interfaces)
              {
                 if (i->macAddr like "85:55:*")
                    return true;
              }
              return false;
              
              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