Future.runCommand
Future.runCommand(target, command, path_to_command)
Returns a DiscoveredCommandResult node containing the result of running the specified command. Enables command paths to be restricted.
Where command is the command to run.
The path_to_command parameter is the path to the command including the command itself, without arguments.
Where the function encounters short 8.3 format paths on Windows, it expands them to the full path. To determine the full path, it will run additional commands.
The target node can be one of the following:
Host | DiscoveryAccess | DiscoveredDirectoryEntry |
DiscoveredFQDN | DiscoveredHBA | DiscoveredListeningPort |
DiscoveredNetworkConnection | DiscoveredNetworkInterface | DiscoveredProcess |
DiscoveredSNMPRow | DiscoveredWMI | SQLResultRow |
DirectoryListing | DiscoveredPackages | DiscoveredSNMPTable |
DiscoveredWMIQuery | FQDNList | HBAInfoList |
IntegrationResult | InterfaceList | NetworkConnectionList |
ProcessList | DeviceInfo | DiscoveredCommandResult |
DiscoveredFile | DiscoveredPatches | DiscoveredRegistryValue |
DiscoveredSNMP | HostInfo |
The following table compares existing discovery.runCommand function call with their Future.runCommand equivalents:
Existing discovery.runCommand | Equivalent Future.runCommand | Source of example (TKU pattern module) |
---|---|---|
discovery.runCommand( | Future.runCommand(process, "%process.cmd% -v", process.cmd); | Acresso.FLEXnetPublisher |
discovery.runCommand( host, '%install_root%%sep%bin%sep%activemq --version'); | Future.runCommand( | Apache.ActiveMQ |
discovery.runCommand( | Future.runCommand( | IBM.DB2.RDBMS |
jenkins_cmd := '%process.cmd% -jar %jenkins_war_file% --version'; | jenkins_cmd := '%process.cmd% -jar %jenkins_war_file% --version'; | OpenSource.Jenkins |
version_command := "cmd /c %install_root%\\etc\\iw.tssearch -v"; | version_command := "%install_root%\\etc\\iw.tssearch"; | Autonomy.InterwovenUniversalSearch |