dstat_snmp_load.py (dstat-0.7.3) | : | dstat_snmp_load.py (dstat-0.7.4) | ||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
self.width = 4 | self.width = 4 | |||
self.scale = 0.5 | self.scale = 0.5 | |||
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): | |||
map(lambda x, y: self.val.update({x: float(y)}), self.vars, snmpwalk(sel f.server, self.community, (1,3,6,1,4,1,2021,10,1,3))) | list(map(lambda x, y: self.val.update({x: float(y)}), self.vars, snmpwal k(self.server, self.community, (1,3,6,1,4,1,2021,10,1,3)))) | |||
# vim:ts=4:sw=4:et | # vim:ts=4:sw=4:et | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |