OK, so I fixed it. I am attaching the steps taken. Right or wrong, this allows the DockerListener.py to run on a given machine via the Wazuh agent. I saw that the DockerListener installed on the wazuh-manager by accident had a functional DockerListener as well as a .py. I had to edit it a little for lack of the /framework folders
Install Agent
apt update
apt install wazuh-agent
Install Python for Docker
apt install python-pip
pip install docker
Edit Config
cd /var/ossec/etc/ossec.conf
add ManagerIP
add Docker Listener wodle:
<wodle name="docker-listener">
<disabled>no</disabled>
</wodle>
Fix Broken default DockerListener
mv DockerListener DockerListener.py
copy dockerlistener config from below
nano DockerListener
paste in:
#!/bin/sh
# Copyright (C) 2015-2020, Wazuh Inc.
# This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
WPYTHON_BIN="/usr/bin/python"
SCRIPT_PATH_NAME="$0"
DIR_NAME="$(cd $(dirname ${SCRIPT_PATH_NAME}); pwd -P)"
SCRIPT_NAME="$(basename ${SCRIPT_PATH_NAME})"
case ${DIR_NAME} in
*/active-response/bin | */wodles*)
if [ -z "${WAZUH_PATH}" ]; then
WAZUH_PATH="$(cd ${DIR_NAME}/../..; pwd)"
fi
PYTHON_SCRIPT="${DIR_NAME}/${SCRIPT_NAME}.py"
;;
*/bin)
if [ -z "${WAZUH_PATH}" ]; then
WAZUH_PATH="$(cd ${DIR_NAME}/..; pwd)"
fi
PYTHON_SCRIPT="${WAZUH_PATH}/framework/scripts/${SCRIPT_NAME}.py"
;;
*/integrations)
if [ -z "${WAZUH_PATH}" ]; then
WAZUH_PATH="$(cd ${DIR_NAME}/..; pwd)"
fi
PYTHON_SCRIPT="${DIR_NAME}/${SCRIPT_NAME}.py"
;;
esac
${WPYTHON_BIN} ${PYTHON_SCRIPT} "$@"
chown root:ossec DockerListener
chmod +x DockerListener
Systemctl enable wazuh-agent
systemctl start wazuh-agent
I had to remove a $ wazuh variable in the last line which got it running.