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 errors, but works?

Script errors, but works?

Scheduled Pinned Locked Moved Support
11 Posts 3 Posters 12.7k 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

    The following script is erroring, but it's working.  So I'm not sure what's wrong.  I'm not very good at scripting, can anyone help out? Thanks!

    if (($node->snmpSysName != null) && ($node->snmpSysName != "") && (($node->driver == "MIKROTIK") || ($node->driver ~= "CAMBIUM")))
    {
      RenameObject($node, $node->snmpSysName);
    }

    Here's the error:

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

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

      Never mind, I figured it out.  It was erroring on a device that was misconfigured to not poll SNMP.

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

        No, it's still erroring.  It only errors on the netxms server node.

        1 Reply Last reply
        0
        • Z
          Z
          Zebble
          wrote on last edited by
          #4

          Check this thread:

          https://www.netxms.org/forum/general-support/script-execution-error/

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

            Thanks, but that didn't fix it.  It's erroring on the NetXMS server node.

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

              The NetXMS server node reports the alarm, but I think it's erroring on every device.  I'm at 2400 alarms since my last message.

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

                I just confirmed that script doesnt work anymore.  It worked 4 weeks ago when I first set it up, but it's not working now.

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

                  Can you show the full script. Original error message says the error is in line 8, but it's not clear what line is it.

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

                    Line 8 is the first line, here's the script currently after the other changes suggested above.

                    /* Available global variables:
                     *  $object - current object, one of 'NetObj' subclasses
                     *  $node - current object if it is 'Node' class
                     *
                     * Expected return value:
                     *  none - returned value is ignored
                     */
                    if (classof($object =="Node") && (($node->snmpSysName != null) && ($node->snmpSysName != "")) && (($node->driver == "MIKROTIK") || ($node->driver ~= "CAMBIUM")))
                    {
                      RenameObject($node, $node->snmpSysName);
                    }

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

                      classof($object function should have closing bracket: classof($object). Output of this function is string which is compared to "Node"

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

                        Thanks, that's got it sorted out now!

                        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