Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function


Panel
titleDescription

Returns the current state of the matching agents. This function should only be called from the Controller. 

Changed_in
Version8.1.11


If called from an Agent on 8.1.11+, this function will return an exception. 

Client permissions restrictions


Panel
titleSyntax

system.eam.queryAgentStatus(groupIds, agentIds, isConnected)

  • Parameters

List  groupIds -  A list of groups to restrict the results to. If not specified, all groups will be included.

List agentIds -  A list of agent names to restrict the results to. If not specified, all agents will be allowed.

Boolean isConnected - If True, only returns agents that are currently connected. If False, only agents that are considered down will be returned, and if not specified, all agents will be returned.

  • Returns

Dataset  - A dataset with columns AgentName, NodeRole, AgentGroup, LastCommunication, IsConnected, IsRunning, RunningState, RunningStateInt, LicenseKey, and Version, where each row is a new agent.

Possible values for RunningState and RunningStateInt are: 0 = Disconnected, 1 = Running, 2 = Warned, 3 = Errored

  •  Scope

Gateway, Vision Client, Perspective Session

Panel
titleExamples
Code Block
languagepy
titleCode Snippet - Querying Agent Status Information
# This script loops through each row of the dataset and grabs out every value from that row and assigns it to a matching variable. Those variables can then be used in some way.
results=system.eam.queryAgentStatus()
for row in range(results.rowCount):
	agentName=results.getValueAt(row, "AgentName")
	nodeRole=results.getValueAt(row, "NodeRole")
	agentGroup=results.getValueAt(row, "AgentGroup")
	lastComm=results.getValueAt(row, "LastCommunication")
	isConnected=results.getValueAt(row, "IsConnected")
	isRunning=results.getValueAt(row, "IsRunning")
	runningState=results.getValueAt(row, "RunningState")
	runningStateInt=results.getValueAt(row, "RunningStateInt")
	licenseKey=results.getValueAt(row, "LicenseKey")
	platformVersion=results.getValueAt(row, "Version")
	# Can include some code here to use the variables in some way for each row like printing each variable to the console.
Code Block
languagepy
titleCode Snippet - Querying Agent Status Information
# This script grabs status information from agents called Agent1, Agent2, Agent3, and then places the data into a table on the same window.
results=system.eam.queryAgentStatus(agentIds=["Agent1", "Agent2", "Agent3"])
event.source.parent.getComponent('Table').data = results
Panel
titleKeywords

system eam queryAgentStatus, eam.queryAgentStatus