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. Set Interface Expected State by Template?

Set Interface Expected State by Template?

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 20.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
    Storm-Donovan
    wrote on last edited by
    #1

    Is there a way to set interface expected state by a template?  We use Unifi APs and these things change their interface state as often as I change my underwear it seems.  I would like to set NetXMS so that if the device is a Unifi AP, then all interfaces are automatically set to Ignore for expected state.

    I searched the forums and didn't find this situation.  Any help would be much appreciated.

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      That's a moment when the scripting kicks in. Simplest is in HOOK::CreateInterface script - it's being called when creating a new interface. E.g. (for Mikrotik, adjust the OID for Unifi AP):

      if ($node->snmpOID == ".1.3.6.1.4.1.14988.1") {
        PollerTrace("  Setting " . $1->name . " expected state to ignore");
        $1->setExpectedState("IGNORE");
      }
      return true;
      

      If you return false from the script, the interface won't be created at all.

      But for this to work you'd need to delete all interfaces for already created nodes. Alternative approach is to make a script that will loop through all nodes and their interfaces and set expected state - give a note if you need example of such script.

      1 Reply Last reply
      0
      • S
        S
        Storm-Donovan
        wrote on last edited by
        #3

        Thanks Filipp, this is perfect.  We've been changing the expected state when alarms come up, so most of the existing ones are done.  I just wanted something so that new ones are done automagically.

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          Just to note - PollerTrace line is optional - it just produces debug output when configuration poll is executed manually.

          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