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

Started by joel4321, November 11, 2010, 06:44:58 PM

Previous topic - Next topic

joel4321

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

Victor Kirhenshtein

Hi!

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

Best regards,
Victor

joel4321

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

Victor Kirhenshtein

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

joel4321

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

Victor Kirhenshtein

I have added function GetNodeParents in version 1.0.8.

Best regards,
Victor

joel4321

Great!

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

thank you

Joël