deployment-pro: Add NGINX monitoring

pull/559/head
cruizba 2020-11-12 10:23:46 +01:00
parent 03ba1578fd
commit 70d30a5d6c
4 changed files with 62 additions and 0 deletions

View File

@ -1,3 +1,25 @@
filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
templates:
- condition:
contains:
docker.container.name: "nginx"
config:
- module: nginx
access:
input:
type: docker
containers:
ids: "${data.docker.container.id}"
stream: "stdout"
error:
input:
type: docker
containers:
ids: "${data.docker.container.id}"
stream: "stderr"
filebeat.inputs:
- type: container
paths:

View File

@ -0,0 +1,10 @@
metricbeat.modules:
- module: nginx
metricsets: ["stubstatus"]
enabled: true
period: 10s
hosts: ["http://127.0.0.1"]
server_status_path: "nginx_status"
output:
elasticsearch:
hosts: ["${OPENVIDU_PRO_ELASTICSEARCH_HOST}"]

View File

@ -138,6 +138,25 @@ services:
options:
max-size: "${DOCKER_LOGS_MAX_SIZE:-100M}"
metricbeat:
image: docker.elastic.co/beats/metricbeat-oss:7.8.0
network_mode: host
restart: always
user: root
env_file:
- .env
environment:
- OPENVIDU_PRO_ELASTICSEARCH_HOST=${OPENVIDU_PRO_ELASTICSEARCH_HOST:-http://127.0.0.1:9200}
volumes:
- ./beats/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
command: >
/bin/bash -c "metricbeat -e -strict.perms=false
`if [ ! -z $ELASTICSEARCH_USERNAME ]; then echo '-E output.elasticsearch.username=$ELASTICSEARCH_USERNAME'; fi`
`if [ ! -z $ELASTICSEARCH_PASSWORD ]; then echo '-E output.elasticsearch.password=$ELASTICSEARCH_PASSWORD'; fi`"
logging:
options:
max-size: "${DOCKER_LOGS_MAX_SIZE:-100M}"
filebeat:
image: docker.elastic.co/beats/filebeat-oss:7.8.0
network_mode: host

View File

@ -61,6 +61,10 @@ new_ov_installation() {
--output "${BEATS_FOLDER}/filebeat.yml" || fatal_error "Error when downloading the file 'filebeat.yml'"
printf '\n - filebeat.yml'
curl --silent ${DOWNLOAD_URL}/openvidu-server/deployments/pro/docker-compose/openvidu-server-pro/beats/metricbeat.yml \
--output "${BEATS_FOLDER}/metricbeat.yml" || fatal_error "Error when downloading the file 'metricbeat.yml'"
printf '\n - metricbeat.yml'
curl --silent ${DOWNLOAD_URL}/openvidu-server/deployments/pro/docker-compose/openvidu-server-pro/.env \
--output "${OPENVIDU_FOLDER}/.env" || fatal_error "Error when downloading the file '.env'"
printf '\n - .env'
@ -198,6 +202,10 @@ upgrade_ov() {
--output "${TMP_FOLDER}/filebeat.yml" || fatal_error "Error when downloading the file 'filebeat.yml'"
printf '\n - filebeat.yml'
curl --silent ${DOWNLOAD_URL}/openvidu-server/deployments/pro/docker-compose/openvidu-server-pro/beats/metricbeat.yml \
--output "${TMP_FOLDER}/metricbeat.yml" || fatal_error "Error when downloading the file 'metricbeat.yml'"
printf '\n - metricbeat.yml'
curl --silent ${DOWNLOAD_URL}/openvidu-server/deployments/pro/docker-compose/openvidu-server-pro/.env \
--output "${TMP_FOLDER}/.env" || fatal_error "Error when downloading the file '.env'"
printf '\n - .env'
@ -301,6 +309,9 @@ upgrade_ov() {
mv "${TMP_FOLDER}/filebeat.yml" "${OPENVIDU_PREVIOUS_FOLDER}/beats/filebeat.yml" || fatal_error "Error while updating 'filebeat.yml'"
printf '\n - filebeat.yml'
mv "${TMP_FOLDER}/metricbeat.yml" "${OPENVIDU_PREVIOUS_FOLDER}/beats/metricbeat.yml" || fatal_error "Error while updating 'metricbeat.yml'"
printf '\n - metricbeat.yml'
printf "\n => Deleting 'tmp' folder"
rm -rf "${TMP_FOLDER}" || fatal_error "Error deleting 'tmp' folder"