Skip to content

Commit

Permalink
Fix network name and agent register command
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriscos committed Dec 7, 2023
1 parent c48323a commit b525cf9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docker/osd-dev/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,18 @@ up)

# Display a command to deploy an agent when using the real server
if [[ "$5" =~ "server" ]]; then
WAZUH_AGENT_VERSION=$(grep "^WAZUH_VERSION=" dev.env | sed "s|WAZUH_VERSION=||")
echo
echo "**************WARNING**************"
echo "The agent version must be a published one. This uses only released versions."
echo "If you need to change de version, edit the command as you see fit."
echo "***********************************"
echo "1. (Optional) Enroll an agent (Ubuntu 20.04):"
echo "docker run --name ${COMPOSE_PROJECT_NAME}-agent --network ${COMPOSE_PROJECT_NAME} --label com.docker.compose.project=${COMPOSE_PROJECT_NAME} -d ubuntu:20.04 bash -c '"
echo "docker run --name ${COMPOSE_PROJECT_NAME}-agent-\$(date +%s) --network os-dev-${OS_VERSION} --label com.docker.compose.project=${COMPOSE_PROJECT_NAME} --env WAZUH_AGENT_VERSION=$(grep "^WAZUH_VERSION=" dev.env | sed "s|WAZUH_VERSION=||") -d ubuntu:20.04 bash -c '"
echo " apt update -y"
echo " apt install -y curl lsb-release"
echo " curl -so \wazuh-agent-${WAZUH_AGENT_VERSION}.deb \\"
echo " https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${WAZUH_AGENT_VERSION}-1_amd64.deb \\"
echo " && WAZUH_MANAGER='wazuh.manager' WAZUH_AGENT_GROUP='default' dpkg -i ./wazuh-agent-${WAZUH_AGENT_VERSION}.deb"
echo " curl -so \wazuh-agent-\${WAZUH_AGENT_VERSION}.deb \\"
echo " https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_\${WAZUH_AGENT_VERSION}-1_amd64.deb \\"
echo " && WAZUH_MANAGER='wazuh.manager' WAZUH_AGENT_GROUP='default' dpkg -i ./wazuh-agent-\${WAZUH_AGENT_VERSION}.deb"
echo
echo " /etc/init.d/wazuh-agent start"
echo " tail -f /var/ossec/logs/ossec.log"
Expand Down

0 comments on commit b525cf9

Please sign in to comment.