Example #1
0
 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()
Example #2
0
    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()
Example #3
0
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()
Example #4
0
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()
Example #5
0
def main(argv):
    for mibname in argv[1:]:
        load(mibname)
    traps.get_dispatcher(_handler)
    asyncio.start_sigio()
Example #6
0
def main(argv):
    for mibname in argv[1:]:
        load(mibname)
    traps.get_dispatcher(_handler)
    asyncio.start_sigio()