Trigger Remote Command on multiple Agents via API

Started by untiptun, August 13, 2014, 05:30:13 PM

Previous topic - Next topic

untiptun

Hi,

I am new to NetXMS. So far I'm very pleased with it. Among many other things we have the nodes that we monitor grouped in clusters in the Admin Interface. We have some ObjectTools defined and are able to manually trigger remote commands on all the servers in the cluster. But we've reached to a point were we would like to remotely tell Netxms server to trigger that command on all nodes of a cluster (I imagine that the interface sends a command ot the Netxms server - I want to do the same but from my own external script/application). I imagine this is something we could do with the API. Could you please explain how I could do that or maybe point me to some documentation on how to do it ?

I really appreciate your help,
Best regards,
Alex

Victor Kirhenshtein

Hi!

You can execute object tool via Java API or using nxshell (which is a Python wrapper around Java API). Approximate sequence will be following:

1. find cluster object (by name or ID)
2. for each child node object call NXCSession.executeAction

Here you can find more information about API:

http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations
https://www.netxms.org/documentation/javadoc/latest/

Best regards,
Victor