def main(argv): import sys hostPort = argv[1] s = Trapd() s.awaitTraps(hostPort) twistedsnmp.updateReactor() reactor.run()
def main(): import getopt # from snmp_parse_args.c opts = 'Y:VhHm:M:O:I:P:D:dv:r:t:c:Z:e:E:n:u:l:x:X:a:A:p:T:-:3:s:S:L:' args, hosts = getopt.getopt(sys.argv[1:], opts) if not hosts: hosts = ['localhost'] d = defer.DeferredList( [Walker(peername=host, cmdLineArgs=args).start() for host in hosts], consumeErrors=True) d.addBoth(stop) twistedsnmp.updateReactor() reactor.run()
def main(): name = 'localhost' community = 'public' if len(sys.argv) >= 2: name = sys.argv[1] oid = (1,3,6,1,2,1,25,4,2,1,2) t = Table(version = netsnmp.SNMP_VERSION_2c, peername = name, community = community, community_len = len(community)) t.open() t.getTable(oid) twistedsnmp.updateReactor() reactor.run()
def main(): name = 'localhost' community = 'public' if len(sys.argv) >= 2: name = sys.argv[1] oid = (1, 3, 6, 1, 2, 1, 25, 4, 2, 1, 2) t = Table(version=netsnmp.SNMP_VERSION_2c, peername=name, community=community, community_len=len(community)) t.open() t.getTable(oid) twistedsnmp.updateReactor() reactor.run()
def main(): name = 'localhost' community = 'public' if len(sys.argv) >= 2: name = sys.argv[1] oids = sys.argv[2:] g = Getter(version=netsnmp.SNMP_VERSION_1, peername=name, community=community, community_len=len(community)) oids = [tuple(map(int, oid.strip('.').split('.'))) for oid in oids] g.open() g.get(oids) twistedsnmp.updateReactor() reactor.run()
def main(): name = 'localhost' community = 'public' if len(sys.argv) >= 2: name = sys.argv[1] oids = sys.argv[2:] g = Getter(version = netsnmp.SNMP_VERSION_1, peername = name, community = community, community_len = len(community)) oids = [tuple(map(int, oid.strip('.').split('.'))) for oid in oids] g.open() g.get(oids) twistedsnmp.updateReactor() reactor.run()