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 Library - Access to parent object --> Subnet/Container

Script Library - Access to parent object --> Subnet/Container

Scheduled Pinned Locked Moved Support
7 Posts 2 Posters 40.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.
  • J
    J
    joel4321
    wrote on last edited by
    #1

    Hi there

    Does anyone know if it's possible to access the parent object (e.g. subnet/container group name) in a script?

    return $node->parent_name?

    I could only found the standard node variables like $node->id, $node->name...

    Thank you

    Joël

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      No, it's not possible. I can add this as feature request.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • J
        J
        joel4321
        wrote on last edited by
        #3

        Ok, thanks for your quick response.

        For our purpose it would be a nice feature because we have several nodes for each subnet with custom names which are in fact our customer company names. For example we could make use of that in the action alerts like email and customize the subjects with the company names.

        Thank you very much.

        kind regards

        Joël

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Added to bugtracker as feature request. 🙂

          Btw, some message customization can be done using custom attributes for the object. For example, you can define custom attribute MESSAGE and then insert it's value into alarm text by using macro %{MESSAGE}. Of course, this is not a replacement for functionality you was asking for, because it requires manual attribute configuration on each node, but it can help in some cases.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • J
            J
            joel4321
            wrote on last edited by
            #5

            ok, nice  🙂

            thanks for mentioning that possiblity, I already figure it out  😉

            So I'm waiting with patience....

            keep coding that way, it's great!

            kind regards

            Joël

            1 Reply Last reply
            0
            • V
              V
              Victor Kirhenshtein
              wrote on last edited by
              #6

              I have added function GetNodeParents in version 1.0.8.

              Best regards,
              Victor

              1 Reply Last reply
              0
              • J
                J
                joel4321
                wrote on last edited by
                #7

                Great!

                I've tested it, it worked like a charm!

                thank you

                Joël

                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