def traps(self, argv): """traps Enable receiving and display of traps.""" from pycopia import asyncio from pycopia.SNMP import traps traps.get_dispatcher(self._trap_handler) asyncio.start_sigio()
def pytrapd(argv): """pytrapd [-d] Run a SNMP trap handler and email you on reciept of a trap. """ from pycopia import asyncio if len(argv) > 1 and argv[1] == "-d": import daemonize daemonize.daemonize() cf = basicconfig.get_config("trapserver") mailer = TrapMailer(cf) handlers = [mailer] dispatcher = traps.get_dispatcher(handlers) asyncio.poller.loop()
def pytrapd(argv): """pytrapd [-d] Run a SNMP trap handler and email you on reciept of a trap. """ from pycopia import asyncio if len(argv) > 1 and argv[1] == "-d": import daemonize daemonize.daemonize() cf = basicconfig.get_config("./trapserver.conf") mailer = TrapMailer(cf) handlers = [mailer] dispatcher = traps.get_dispatcher(handlers) asyncio.poller.loop()
def main(argv): for mibname in argv[1:]: load(mibname) traps.get_dispatcher(_handler) asyncio.start_sigio()