Skip to content

Instantly share code, notes, and snippets.

@HarryR
Created September 28, 2011 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarryR/1249407 to your computer and use it in GitHub Desktop.
Save HarryR/1249407 to your computer and use it in GitHub Desktop.
/proc/net/netstat plugin for ServerDensity.com
class ProcNetNetstat:
def __init__(self, agentConfig, checksLogger, rawConfig):
pass
def run(self):
dat = {}
for line in open('/proc/net/netstat','r').readlines():
line = line.split()
name = line[0]
line.remove(name)
if name not in dat:
dat[name] = line
else:
dat[name] = dict(zip(dat[name],line))
return dat['TcpExt:']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment