#!/bin/bash set -e # Detener el script si ocurre un error # Configurar Filebeat echo "Verificando conectividad" curl -I --connect-timeout 10 --max-time 30 -s -o /dev/null --retry 5 https://artifacts.elastic.co/downloads/beats/filebeat/ if [[ $? -ne 0 ]]; then echo "ERROR: No se puede conectar a https://artifacts.elastic.co/downloads/beats/filebeat. Verifica tu conexión a Internet o la disponibilidad" exit 1 fi curl --connect-timeout 10 --max-time 60 --retry 5 -L -o /tmp/filebeat-oss-7.12.1-amd64.deb https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-oss-7.12.1-amd64.deb sudo dpkg -i /tmp/filebeat-oss-7.12.1-amd64.deb cp CA/certs/ogagent-fb.mytld.crt.pem /etc/filebeat/ cp CA/private/ogagent-fb.mytld.key.nopass.pem /etc/filebeat/ogagent-fb.mytld.key.pem cat >/etc/filebeat/filebeat.yml <>/etc/hosts <