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. Script execution error

Script execution error

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

    Hi,

    I have a script execution error since upgrading to 3.8-366.  Is it a problem with the script?

    Script (Hook::ConfigurationPoll) execution error: Error 14 in line 2: Function or operation argument is not an object

    // remove dynamic interfaces on Mikrotik, e.g. VPN users
    if ($node->driver  == "MIKROTIK")
    {
      intArray = GetNodeInterfaces($node);
    
      foreach (int : intArray)
      {
        // if the interface is dynamic
        if ((left(int->name, 1) == "<") && (right(int->name, 1) == ">"))
        {
          // delete the interface
          DeleteObject(int);
        }
      }
    }
    

    Thanks in advance.

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

      The code is correct for nodes. But configuration poll could happen for other objects, e.g. clusters. In that case there is $object variable, but $node is not available.
      You can change the 2-nd line to:

      if (classof($object) == "Node" && $node->driver  == "MIKROTIK")
      
      1 Reply Last reply
      0
      • S
        S
        squeezypiano
        wrote on last edited by
        #3

        Thanks, that looks to have sorted it. Strange that script has been running for a year and only broke after the last update.

        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