Created
September 28, 2011 22:16
-
-
Save HarryR/1249407 to your computer and use it in GitHub Desktop.
/proc/net/netstat plugin for ServerDensity.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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