import imp import time import os.path from xmlrpclib import * import threading import time import random SOL_SLEEP_TIME=300 class SignOfLife: def __init__(self): PLUGIN_PATH="/usr/share/n4d/python-plugins/" obj=imp.load_source("DiscoverUsers",PLUGIN_PATH + "DiscoverUsers.py") self.discover=obj.DiscoverUsers() t=threading.Thread(target=self.send_sign) t.setDaemon(True) t.start() #def init def send_sign(self): while True: time.sleep(SOL_SLEEP_TIME + int(SOL_SLEEP_TIME*random.random())) ret=self.discover.discover() print "" print "[SignOfLife] Sending client list..." try: server=ServerProxy("https://server:9779",allow_none=True) server.register_client("","ClientManager",ret) except Exception as e: print "[SignOfLife] Connection to server error..." print e #def send_sign #class SignOfLine if __name__=="__main__": sof=SignOfLife() while True: pass