News:

We really need your input in this questionnaire

Main Menu

Object Tools for Conditions

Started by Beda, January 29, 2015, 01:21:44 PM

Previous topic - Next topic

Beda

Hello,
first, thank you for your great software and continuous development and support.

Maybe this should be a feature request, but I'm not sure that I don't miss already existing way how to do what I want, so I've chosen a General Support section. What I want to achieve is this:

In a Network Map I would want to represent an abstract device whose state is computed from more physical (and virtual) machines by a SNMP polling. I would want to represent the device by 1 icon (i.e. by 1 object), hence a Condition seems to be the right object for me so far.
But I would also want to be able to call a predefined Object Tool (on a predefined Node) from a right-click pop-up menu of the icon in the Map, which forces me to use an object of type Node instead of the Condition.

So far I've used a hack of the management console (I modified its sources), so I'm able to "chain" a Condition with a Node using the Condition's Custom Attribute with the ID of the Node. My modified console then displays a Tools item in a pop-up menu of the Condition. But I think that this modification does not correspond with an intended use of Condition objects, so I would want to ask:

  • Is there a way how to do this using existing objects?
  • If not, how (conceptually) could this functionality be implemented? As a new object? As a modification of an existing one? In another way? Maybe I could try to implement the modifications, but I don't want to corrupt a concept and the intended use of the objects, because I don't have an overall view of the project.

Victor Kirhenshtein

Hi!

If it is not relevant on what exact node you are calling object tool (server command for example), you can create new node with no IP address and use DCI to set it's status.

Best regards,
Victor

Beda

Thank you for your immediate response.

Unfortunately, in my case it is important on which node the Tool is called, because it is a SNMP table tool.

The Condition has an advantage of being able to compute its status based on values from multiple objects, which I need.
But I'd also want to display predefined Object Tool on a predefined node in a pop-up menu of the condition.

The first solution which came on my mind is adding 2 optional parameters to each Object Tool:

  • target node - the node on which the tool will be called regardless of the selected object
  • displaying objects - list of objects (including non-node ones) that will have this tool in their pop-up menus
Tools without these parameters would work as today.
Do you think this solution could be consistent with current concept of the NetXMS?
Could this be achieved in a less complicated way?

tomaskir

You can do all you need to do already on a node object.
Use what Victor said and:

1) Create a NXSL script that calculates the object status as needed.
- NXSL scripts can calculate whatever based on any number of inputs from other nodes, etc...
2) Create a script DCI and deduce node status from the status of this script DCI.
- Victor described this

Tools already support all you need in multiple ways:

1) create a tool that is hard-coded with all details you need.
- filter this tool for the node object you created above
2) Use custom attributes in the tool which would specify what is executed and how
- assign needed attributes to the node object you created above

etc...

Beda

Thank you, you helped me a lot.
The first part is clear, now I am able to set a status of the node based on other nodes.
But I'm afraid that I don't fully understand the second part. How can I hard-code a target node to the Object Tool?

tomaskir

#5
Example, a ping "Local Command" tool:

Normally you would use this as command:
ping %OBJECT_IP_ADDR%

But nothing is stopping you from creating a hard-coded command like this:
ping 1.2.3.4

Or using node's custom attributs like this:
ping %CUSTOM_ATTR_NAME%

You can then set custom attributes on the node as needed... even modify those from within NXSL scripts, so the tool does a different thing under different node statuses... etc...

See this:
https://www.netxms.org/documentation/adminguide/objects.html#object-tools
Look into the "Macro Substitution" section, particularly the last sentance.

Beda

OK, this looks like a very powerful tool.
Unfortunately I'd want to create a SNMP Table tool which (according to the admin-guide) doesn't support neither macro substitution nor setting a target IP.
And without the target IP setting I can't predefine a SNMP Table tool which is independent on IP of the selected node.