Module netstat :: Class NetStat
[hide private]
[frames] | no frames]

Class NetStat

source code


Parses /proc/net/{tcp,udp} and returns a list of NetProcesses. Is also able to find a matching pid/progname for the process.

Instance Methods [hide private]
 
__init__(self, filename, proc_mount)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__get_progname_for_pid(self, pid)
Walks through the /proc/<pid>/ hierarchy and tries to match an open socket with a pid or progname
source code
 
__process_one_pid(self, pid)
Returns True if the pid has any open socket from self.__processes and False if not
source code
 
match_inode_pid(self)
Walk through /proc/<pid>/fd/* and find matching process for these sockets
source code
 
read_file(self)
Parses the file given to contructor.
source code
 
get_processes(self)
Return all processes the objects holds
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, proc_mount)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)