远程下发任务

Agent端

首先需要在每一台Agent的/var/ossec/etc/local_internal_options.conf路径添加一下内容

logcollector.remote_commands=1
wazuh_command.remote_commands=1

接着重启agent

systemctl restart wazuh-agent

如果修改配置出现什么问题的话可以通过这个命令来调试

/var/ossec/bin/wazuh-control start

Manager端

比如我们的这个Agent的组是默认的default,那么我们就可以修改/var/ossec/etc/shared/default/agent.conf这个配置文件,在里面添加我们需要的配置,官方文档

<agent_config os="Linux">
<localfile>
<log_format>full_command</log_format>
<command>ip a</command>
<alias>get_ip</alias>
<frequency>10</frequency>
</localfile>
</agent_config>

保存后Agent端就会自动的获取这个内容了,包括default文件夹下面的所有文件都会下发到agent上