def etherscan(riemann_host, riemann_port, chain): """monitor etherscan for latest blocknumber""" logging.basicConfig(level=logging.INFO) logger.info("version %s starting", util.get_version()) logger.info("watching %s at %s", chain, name2url[chain]) util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_etherscan, chain), 10, )
def psql(riemann_host, riemann_port, sqlquery): """monitor query from a postgresql database""" logging.basicConfig(level=logging.INFO) logger.info("version %s starting", util.get_version()) util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_psql, sqlquery), 10, )
def relay(riemann_host, riemann_port, url): """monitor relay server""" logging.basicConfig(level=logging.INFO) logger.info("version %s starting", util.get_version()) logger.info("watching %s", url) util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_relay, url), 10, )
def website(riemann_host, riemann_port, url, original_hash): """Monitor website for changed sources.""" logging.basicConfig(level=logging.INFO) logger.info(f"version {util.get_version()} starting") logger.info(f"watching {url} sources with original hash {original_hash}") util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_website, url, original_hash), 120, )
def auction_backend(riemann_host, riemann_port, base_url): """Monitor auction backend for availability.""" logging.basicConfig(level=logging.INFO) logger.info(f"Version {util.get_version()} starting") logger.info(f"Watching '{base_url}' backend for availability") util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_auction_backend, base_url), 10, )
def jsonrpc(riemann_host, riemann_port, url, event_host_dwim): """watch geth/parity for latest block number""" logging.basicConfig(level=logging.INFO) logger.info("version %s starting", util.get_version()) logger.info("watching %s", url) if event_host_dwim: hostname = urlparse(url).hostname if hostname in ("localhost", "127.0.0.1"): event_host = socket.gethostname() else: event_host = hostname else: # Let's stay compatible with what we had before event_host = url util.watch_report_loop( lambda: bernhard.Client(riemann_host, riemann_port), functools.partial(watch_jsonrpc, url, event_host), 10, )