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. Issue with auto apply/remove template

Issue with auto apply/remove template

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 28.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.
  • A
    A
    adimitrov
    wrote on last edited by
    #1

    Hello team,

    I have configured a simple script which work as a DCI in NetXMS. The script and the DCI works perfect, but the devices on which i need the script are a lot and i have configured auto apply on a template, which seemed to be working fine.

    The auto apply script is really simple, it check if the device have a specific Custom Attribute and if it is router or switch:

    if ((GetCustomAttribute($node, "RANCID_ENABLED") ~= "1") && ($node->isRouter ~= "1") || ($node->isBridge ~= "1"))
    { return true;
    } else {
    return false;
    }

    Yesterday for some reason auto apply set devices under the template which doesn't really apply to the filter. This resulted in false positive alarms. The strange thing is when i initiate configuration poll the DCI is not removed. If removed manually it does not apply again (just tried to reproduce the issue). Is there a problem with automatically removing DCI when they no longer passes though the filter?
    Configuration poll with debug level 6 from problematic device attached (nothing happens).


    confpoll.txt

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

      We have not faced any issues with auto remove.
      Please verify, that "Remove this template automatically when node no longer passes through filter" option is selected for the template on "Automatic Apply Rules" property page.

      Also in your script:
      Template will be applied to all routers with custom attribute or to bridges(with or without custom attributes). If you want to check custom attributes for bot is should look like:

      if ((GetCustomAttribute($node, "RANCID_ENABLED") ~= "1") && (($node->isRouter ~= "1") || ($node->isBridge ~= "1")))
      { return true;
      } else {
      return false;
      }

      1 Reply Last reply
      0
      • A
        A
        adimitrov
        wrote on last edited by
        #3

        Hello Tatjana, team,

        I can confirm that "Remove this template automatically when node no longer passes through filer" option is selected. Thanks for pointing my mistake out. I will check if this is the issue here and will update.

        Best regards,
        Adrian

        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