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. Config Poll Hook script error help

Config Poll Hook script error help

Scheduled Pinned Locked Moved Support
4 Posts 3 Posters 11.6k 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.
  • G
    G
    gmonk63
    wrote on last edited by
    #1

    I am using the following script to rename the node to the discovered snmp name 

    9  if (($node.snmpSysName != "") and ($node.snmpSysName !=null))
    10 {
    11 return $object.rename($node->snmpSysName);
    12 }

    I always get this error and Im not sure why as it compiles and runs without issue
    Script (Hook::ConfigurationPoll) execution error: Error 14 in line 9: Function or operation argument is not an object

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2

      This hook is not limited to Nodes, so $node can be null while $object is set.
      If you are interested in nodes only, just check for $node:

      if ($node and not $node.snmpSysName.isEmpty()) {
         $node.rename($node.snmpSysName);
      }
      
      1 Reply Last reply
      0
      • G
        G
        gmonk63
        wrote on last edited by
        #3

        Thank you.. Is this still needed ?  I see that the server config has the following 

        Objects.Nodes.ResolveNames   according to the description this resolves using DNS,SNMP system name ...

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

          Objects.Nodes.ResolveNames - this works only when node is created. 
          There's Objects.Nodes.SyncNamesWithDNS, but this one is taking names from DNS only (also not that activating this parameter currently requires server restart which contradicts with what UI is saying - it's a bug)

          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