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. Using data from the device General tab for template auto-apply

Using data from the device General tab for template auto-apply

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

    I can see the vendor and product name in the general tab of an added node. How can I use this information automatic apply rules for a template? I have scoured the MIBs can not seem to find it.

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

      Got it! I just need to reference $node->productName in the Rule.

      1 Reply Last reply
      0
      • D
        D
        DesertRat
        wrote on last edited by
        #3

        I have added this to the Auto Apply filter and it still doesn't apply the template to the nodes. What am I missing?

        return $node.productName like "ePMP3000 (FCC)";

        1 Reply Last reply
        0
        • D
          D
          DesertRat
          wrote on last edited by
          #4

          I tried this too and still no joy.

          return ($node.productName ~= "ePMP3000 (FCC)") ? true : false;

          1 Reply Last reply
          0
          • M
            M
            Millenium7
            wrote on last edited by
            #5

            Just a guess but I think you need to return a 'true' or 'false' in order for it work
            And it could be that your RegEx syntax is wrong?

            Maybe try "ePMP3000 \(FCC\)" the backslashes mean a literal '(' or ')' otherwise () implies a capture group
            You could also try "ePMP3000.*" if you don't care about it having to exactly have "(FCC)" on the end

            1 Reply Last reply
            0
            • M
              M
              Millenium7
              wrote on last edited by
              #6

              Otherwise here's a sample of what I use for Cambium ePMP series (all of them, not just 3000 specifically)

              // ePMP series
              if ($node->snmpOID ~= "(.1.3.6.1.4.1.17713.21.9).*") return true;
              
              1 Reply Last reply
              0
              • V
                V
                Victor Kirhenshtein
                wrote on last edited by
                #7

                Your syntax is wrong - you should use -> operator for accessing object properties (dot is string concatenation). Also, brackets denote capture group in regular expression, you should escape them with backslashes.

                return $node->productName ~= "ePMP3000 \\(FCC\\)";
                

                should work.

                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