def main():

    options = parse_options()
    log.init(options.logfile, options.loglevel)

    if options.pidfile:
        util.write_pid(options.pidfile)

    site = monitor_api.MonitorSite()
    site.root.putChild("nagios", nagios_api.NagiosStatus(options.nagios))

    if not options.read_only:
        try:
            rpc = nagios_api.NagiosXMLRPC(options.nagios)
        except errors.InitError, ex:
            log.error(str(ex))
            sys.exit(1)
        site.root.putChild("RPC2", rpc)

    reactor.listenTCP(options.port, site, interface=options.host)

    if options.daemon:
        util.daemonize(options.pidfile)

    log.init_stdio()
    reactor.run()
Start up NagCat, profiling things as requested
dataset/ETHPy150Open marineam/nagcat/python/nagcat/nagnet.py/main