Exemplo n.º 1
0
def setup_monitoring(config):
    try:
        name = "observant-dashboard-%s" % str(config.get("dashboard", "port"))
        client = StatsCore.attchToStatsDaemon()
        client.postWatchPid(name, os.getpid())
        client.close()
    except:
        logging.error("Unable to setup monitoring: [%s]" % str(sys.exc_info()))
Exemplo n.º 2
0
def isDaemonRunning(config):
    try:
        lock = str(config.get('daemon', 'lock'))
        sock = str(config.get('daemon', 'sock'))
        client = StatsCore.attchToStatsDaemon(pid=lock, sock=sock)
        print(client.postDaemonStatusMessage())
        client.close()
        return True
    except:
        return str(sys.exc_info()[1])
Exemplo n.º 3
0
def killDaemon(config):
    lock = str(config.get('daemon', 'lock'))
    sock = str(config.get('daemon', 'sock'))
    client = StatsCore.attchToStatsDaemon(pid=lock, sock=sock)
    client.postStopDaemon()
    client.close()