Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Network Utilization

 
Vadivel Murugesan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. Ranchers,

Is there anyway to find Utilization of Network on System using Java API'S?

Thanks in Advance
 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not directly, as far as I know. If it's available, you could access an SNMP or WBEM server on the system over the network, which is fairly cross-platform.

For less cross-platform solutions, you could use the WMI scripting APIs via COM/ActiveX on Windows, or you could parse files like /proc/net/dev on Linux.
 
vipin jos
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to connect from a Windows machine to Solaris machine and run commands like netstat, one of the quick and dirty ways is to use plink(available in the PuTTY downloads page).

Use Runtime exec and run plink with the commands you need.

Read the output and parse.

Another much more decent alternative is to use OpenSSH
 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vipin jos:
If you want to connect from a Windows machine to Solaris machine and run commands like netstat, one of the quick and dirty ways is to use plink(available in the PuTTY downloads page).

There are SSH libraries for Java like Trilead SSH too, which may be easier to use than Runtime.exec().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic