"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_snmp_sys.py" between
dstat-0.7.3.tar.gz and dstat-0.7.4.tar.gz

About: dstat is a versatile resource statistic tool and a replacement for vmstat, iostat and ifstat (using Python).

dstat_snmp_sys.py  (dstat-0.7.3):dstat_snmp_sys.py  (dstat-0.7.4)
skipping to change at line 19 skipping to change at line 19
self.width = 5 self.width = 5
self.scale = 1000 self.scale = 1000
self.server = os.getenv('DSTAT_SNMPSERVER') or '192.168.1.1' self.server = os.getenv('DSTAT_SNMPSERVER') or '192.168.1.1'
self.community = os.getenv('DSTAT_SNMPCOMMUNITY') or 'public' self.community = os.getenv('DSTAT_SNMPCOMMUNITY') or 'public'
def check(self): def check(self):
try: try:
global cmdgen global cmdgen
from pysnmp.entity.rfc3413.oneliner import cmdgen from pysnmp.entity.rfc3413.oneliner import cmdgen
except: except:
raise Exception, 'Needs pysnmp and pyasn1 modules' raise Exception('Needs pysnmp and pyasn1 modules')
def extract(self): def extract(self):
self.set2['intr'] = int(snmpget(self.server, self.community, (1,3,6,1,4, 1,2021,11,59,0))) self.set2['intr'] = int(snmpget(self.server, self.community, (1,3,6,1,4, 1,2021,11,59,0)))
self.set2['ctxt'] = int(snmpget(self.server, self.community, (1,3,6,1,4, 1,2021,11,60,0))) self.set2['ctxt'] = int(snmpget(self.server, self.community, (1,3,6,1,4, 1,2021,11,60,0)))
if update: if update:
for name in self.vars: for name in self.vars:
self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / ela psed self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / ela psed
if step == op.delay: if step == op.delay:
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)