[erlang-questions] TCP open port count

Roberto Ostinelli roberto.ostinelli@REDACTED
Sat Feb 14 13:25:06 CET 2015


Indeed. However, since this information is available in crash dumps (i.e. howmany tcp and udp ports were used) I thought there might be a direct way to access this information. 

Maybe when a crash dump is generated, there is a loop that checks for every port type just in the way that it has been suggested. 



> On 13/feb/2015, at 17:59, Wes James <comptekki@REDACTED> wrote:
> 
> Via os:cmd??
> 
> {Open_ports_pre, _} = string:to_integer(os:cmd("netstat -a | egrep 'Proto|LISTEN' | wc -l")).
> 
> Open_ports = Open_ports_pre-2.
> 
> -wes
> 
>> On Fri, Feb 13, 2015 at 9:03 AM, Roberto Ostinelli <roberto@REDACTED> wrote:
>> Dear list,
>> Is there a system command that can easily tell me how many TCP ports are open on a system?
>> 
>> erlang:system_info(port_count)
>> 
>> This returns all port, I'd like to know only the TCP ones.
>> 
>> Thank you,
>> r.
>> 
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150214/b667e1e2/attachment.htm>


More information about the erlang-questions mailing list