Process-to-port mapping with SNMP and/or wmi/wmic in java

Posted by Niddy888 on Stack Overflow See other posts from Stack Overflow or by Niddy888
Published on 2010-05-02T14:12:35Z Indexed on 2010/05/02 14:17 UTC
Read the original article Hit count: 244

Filed under:
|
|

I'm trying to use SNMP to map outgoing ports on my host computer with the application running on the computer that is responsible for that communication.

When running "netstat -ano" I get access to Protocol, Local Address (with port), Foreign Address (with port), State and PID. But I want to do this entirely without having to execute "cmd" from Java.

By using SNMP OID: .1.3.6.1.2.1.25.4 (.iso.org.dod.internet.mgmt.mib-2.host.hrSWRun) I get access to PID (ex. 1704), Name (ex. cmd.exe), Path (ex. C:\Windows\system32) among others. There is an SNMP OID: .1.3.6.1.2.1.6.13 (.iso.org.dod.internet.mgmt.mib-2.tcp.tcpConnTable) that give you access to TCP connection state, local address, local port, remote address, remote port. But NO PID.

So to sum up. My question again: Is there a way to "map" these tables together? Either directly in SNMP with other OID's or in conjunction with WMI / WMIC?

© Stack Overflow or respective owner

Related posts about snmp

Related posts about java