How to identify the agent using port on Windows

Document ID : KB000015910
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

 

How to identify another agent installed on this machine that is using the same port number. 

On Windows the agent may fail to start if the port the agent is listening on is not available.

The defaultlog_agent with contain an error

Caused by: java.net.BindException: Address already in use (Bind failed) 

 

 

 

Question:

How to identify the agent that is configured on the default port 7520

Environment:
Windows
Answer:

Open a command prompt window (as Administrator) From "Start\Search box" Enter "cmd" then right-click on "cmd.exe" and select "Run as Administrator" 
Enter the following text then hit Enter. netstat -abno > c:\portsinuse.txt 
Open c:\portsinuse.txt in notepad and search for the port 7520 to find the Port that you are listening on under "Local Address" 
Look at the process name directly under that 
I suspect you are going to see [cybAgent.exe] another agent on this machine 

Example: 
Proto Local Address Foreign Address State PID 
TCP 0.0.0.0:7520 0.0.0.0:0 LISTENING 3088 
[cybAgent.exe] 


You can open task manager and sort by PID to see the cybagent.exe running and right click properties to see the location, where it is installed. 

The agents port is configured in the agentparm.txt file that is located in the directory the agent is installed in. Here is an example from my machine that shows port is configured at 7520 

# Communications 

communication.inputport=7520 

Changes to the agentparm.txt do not take effect until the agent is stopped and started. 

To Stop the agent: 
agent_install_path\cybAgent -s 
Start the agent: 
agent_install_path\cybAgent -a 

The agent should start once it is configured to use a port that is available.