def onAgentInit(self, client, tid, request): """ Function to overwrite """ Logger.instance().info("init received") self.logWarning(msg="init called: %s" % request['data']) self.sendNotify(request=request, data="notify sent")
def onAgentNotify(self, client, tid, request): """ Function to overwrite """ Logger.instance().info("notify received") self.logWarning(msg="notify received: %s" % request['data']) self.sendData(request=request, data={'a': '\x00é'}) self.sendError(request=request, data="error sent")
def onAgentReset(self, client, tid, request): """ Function to overwrite """ Logger.instance().info("reset received") if 'data' in request: self.logWarning(msg="reset called: %s" % request['data']) else: self.logWarning(msg="reset called")
def onAgentAlive(self, client, tid, request): """ Function to overwrite """ Logger.instance().info("alive received")
Logger.instance().info("init received") self.logWarning(msg="init called: %s" % request['data']) self.sendNotify(request=request, data="notify sent") def onAgentAlive(self, client, tid, request): """ Function to overwrite """ Logger.instance().info("alive received") if __name__ == '__main__': app = QApplication(sys.argv) # initiliaze settings application, read settings from the ini file Settings.initialize() # initialize logger logPathFile = "%s/%s" % ( Settings.getDirExec(), Settings.instance().readValue( key ='Trace/file' ) ) level = Settings.instance().readValue( key ='Trace/level' ) size = Settings.instance().readValue( key ='Trace/max-size-file' ) nbFiles = int( Settings.instance().readValue( key ='Trace/nb-backup-max' ) ) Logger.initialize( logPathFile=logPathFile, level=level, size=size, nbFiles=nbFiles, noSettings=True ) # init the plugin # MyPlugin = CorePlugin.GenericPlugin( Plugin = MyPlugin( pluginName=CONFIG_JSON["plugin"]["name"], pluginType=CONFIG_JSON["plugin"]["type"] ) sys.exit(app.exec_())