Parse::Netstat man page on Hurd

Man page or keyword search:  
man Server   6387 pages
apropos Keyword Search (all sections)
Output format
Hurd logo
[printable version]

Parse::Netstat(3pm)   User Contributed Perl Documentation  Parse::Netstat(3pm)

NAME
       Parse::Netstat - Parse the output of Unix "netstat" command

VERSION
       version 0.04

SYNOPSIS
	use Parse::Netstat qw(parse_netstat);

	my $output = `netstat -anp`;
	my $res = parse_netstat output => $output;

       Sample result:

	[
	 200,
	 "OK",
	 {
	   active_conns => [
	     {
	       foreign_host => "0.0.0.0",
	       foreign_port => "*",
	       local_host => "127.0.0.1",
	       local_port => 1027,
	       proto => "tcp",
	       recvq => 0,
	       sendq => 0,
	       state => "LISTEN",
	     },
	     ...
	     {
	       foreign_host => "0.0.0.0",
	       foreign_port => "*",
	       local_host => "192.168.0.103",
	       local_port => 56668,
	       proto => "udp",
	       recvq => 0,
	       sendq => 0,
	     },
	     ...
	     {
	       flags   => "ACC",
	       inode   => 15631,
	       path    => "\@/tmp/dbus-VS3SLhDMEu",
	       pid     => 4513,
	       program => "dbus-daemon",
	       proto   => "unix",
	       refcnt  => 2,
	       state   => "LISTENING",
	       type    => "STREAM",
	     },
	   ],
	 }
	]

DESCRIPTION
       This module provides parse_netstat().

SEE ALSO
FUNCTIONS
   parse_netstat(%args) -> [status, msg, result, meta]
       Parse the output of Unix "netstat" command.

       Arguments ('*' denotes required arguments):

       ·   output* => str

	   Output of netstat command.

	   This function only parses program's output. You need to invoke
	   "netstat" on your own.

       ·   tcp => bool (default: 1)

	   Whether to parse tcp connections.

       ·   udp => bool (default: 1)

	   Whether to parse udp connections.

       ·   unix => bool (default: 1)

	   Whether to parse unix connections.

       Return value:

       Returns an enveloped result (an array). First element (status) is an
       integer containing HTTP status code (200 means OK, 4xx caller error,
       5xx function error). Second element (msg) is a string containing error
       message, or 'OK' if status is 200. Third element (result) is optional,
       the actual result. Fourth element (meta) is called result metadata and
       is optional, a hash that contains extra information.

AUTHOR
       Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE
       This software is copyright (c) 2012 by Steven Haryanto.

       This is free software; you can redistribute it and/or modify it under
       the same terms as the Perl 5 programming language system itself.

perl v5.18.1			  2013-08-27		   Parse::Netstat(3pm)
[top]

List of man pages available for Hurd

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net