func (t *Agent) MinePlugins(args model.AgentHeartbeatRequest, reply *model.AgentPluginsResponse) error { if args.Hostname == "" { return nil } reply.Plugins = cache.GetPlugins(args.Hostname) reply.Timestamp = time.Now().Unix() return nil }
func (t *Agent) MinePlugins(args model.AgentHeartbeatRequest, reply *model.AgentPluginsResponse) error { if args.Hostname == "" { return nil } reply.Plugins = cache.GetPlugins(args.Hostname) reply.Timestamp = time.Now().Unix() debug := g.Config().Debug if debug { log.Printf("[DEBUG] MinePlugins args is %v, reply is %v", args, reply) } return nil }
func (t *Agent) MinePlugins(args model.AgentHeartbeatRequest, reply *model.AgentPluginsResponse) error { if args.Hostname == "" { return nil } plugins := cache.GetPlugins(args.Hostname) checksum := "" if len(plugins) > 0 { checksum = utils.Md5(strings.Join(plugins, "")) } if args.Checksum == checksum { reply.Plugins = []string{} } else { reply.Plugins = plugins } reply.Checksum = checksum reply.Timestamp = time.Now().Unix() return nil }